use of org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient in project product-is by wso2.
the class ApplicationAuthzTestCase method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init(TestUserMode.SUPER_TENANT_ADMIN);
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
applicationManagementServiceClient = new ApplicationManagementServiceClient(sessionCookie, backendURL, configContext);
ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
remoteUSMServiceClient = new RemoteUserStoreManagerServiceClient(backendURL, sessionCookie);
entitlementPolicyClient = new EntitlementPolicyServiceClient(backendURL, sessionCookie);
httpClientAzUser = HttpClientBuilder.create().setDefaultCookieStore(new BasicCookieStore()).build();
httpClientNonAzUser = HttpClientBuilder.create().setDefaultCookieStore(new BasicCookieStore()).build();
createRole(AZ_TEST_ROLE);
createUser(AZ_TEST_USER, AZ_TEST_USER_PW, new String[] { AZ_TEST_ROLE });
userId = UserUtil.getUserId(MultitenantUtils.getTenantAwareUsername(AZ_TEST_USER), isServer.getContextTenant());
createUser(NON_AZ_TEST_USER, NON_AZ_TEST_USER_PW, new String[0]);
createApplication(APPLICATION_NAME);
createSAMLApp(APPLICATION_NAME, true, true, true);
setupXACMLPolicy(POLICY_ID, POLICY);
}
use of org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient in project product-is by wso2.
the class AbstractIdentityFederationTestCase method createServiceClients.
public void createServiceClients(int portOffset, String sessionCookie, IdentityConstants.ServiceClientType[] adminClients) throws Exception {
if (adminClients == null) {
return;
}
String serviceUrl = getSecureServiceUrl(portOffset, automationContextMap.get(portOffset).getContextUrls().getSecureServiceUrl());
if (sessionCookie == null) {
AuthenticatorClient authenticatorClient = new AuthenticatorClient(serviceUrl);
sessionCookie = authenticatorClient.login(automationContextMap.get(portOffset).getSuperTenant().getTenantAdmin().getUserName(), automationContextMap.get(portOffset).getSuperTenant().getTenantAdmin().getPassword(), automationContextMap.get(portOffset).getDefaultInstance().getHosts().get("default"));
}
if (sessionCookie != null) {
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
for (IdentityConstants.ServiceClientType clientType : adminClients) {
if (IdentityConstants.ServiceClientType.APPLICATION_MANAGEMENT.equals(clientType)) {
applicationManagementServiceClients.put(portOffset, new ApplicationManagementServiceClient(sessionCookie, serviceUrl, configContext));
} else if (IdentityConstants.ServiceClientType.IDENTITY_PROVIDER_MGT.equals(clientType)) {
identityProviderMgtServiceClients.put(portOffset, new IdentityProviderMgtServiceClient(sessionCookie, serviceUrl));
} else if (IdentityConstants.ServiceClientType.SAML_SSO_CONFIG.equals(clientType)) {
samlSSOConfigServiceClients.put(portOffset, new SAMLSSOConfigServiceClient(serviceUrl, sessionCookie));
} else if (IdentityConstants.ServiceClientType.OAUTH_ADMIN.equals(clientType)) {
oauthAdminClients.put(portOffset, new OauthAdminClient(serviceUrl, sessionCookie));
}
}
}
}
use of org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient in project product-is by wso2.
the class CrossProtocolLogoutTestCase method init.
protected void init() throws Exception {
super.init();
adminClient = new OauthAdminClient(backendURL, sessionCookie);
ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
applicationManagementServiceClient = new ApplicationManagementServiceClient(sessionCookie, backendURL, null);
}
use of org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient in project product-is by wso2.
the class OAuth2ServiceSAML2BearerGrantTestCase method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init(TestUserMode.SUPER_TENANT_USER);
ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
OAuthConsumerAppDTO oauthApp = createDefaultOAuthApplication();
createDefaultSAMLApplication();
consumerKey = oauthApp.getOauthConsumerKey();
consumerSecret = oauthApp.getOauthConsumerSecret();
client = HttpClientBuilder.create().build();
log.info(String.format("Oauth app initialized with key: %s, secret: %s.", consumerKey, consumerSecret));
}
use of org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient in project product-is by wso2.
the class RequestPathBasicAuthenticationSSOTest method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init();
logManger = new AuthenticatorClient(backendURL);
adminUsername = userInfo.getUserName();
adminPassword = userInfo.getPassword();
logManger.login(isServer.getSuperTenant().getTenantAdmin().getUserName(), isServer.getSuperTenant().getTenantAdmin().getPassword(), isServer.getInstance().getHosts().get("default"));
appMgtclient = new ApplicationManagementServiceClient(sessionCookie, backendURL, null);
ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
client = HttpClientBuilder.create().build();
isURL = backendURL.substring(0, backendURL.indexOf("services/"));
ssoConfigServiceClient.addServiceProvider(createSAMLServiceProviderDTO(ISSUER_TRAVELOCITY_COM));
ssoConfigServiceClient.addServiceProvider(createSAMLServiceProviderDTO(ISSUER_AVIS_COM));
serviceProviderTravelocity = new ServiceProvider();
serviceProviderTravelocity.setApplicationName(SERVICE_PROVIDER_NAME_TRAVELOCITY);
serviceProviderTravelocity.setDescription(SERVICE_PROVIDER_DESC);
appMgtclient.createApplication(serviceProviderTravelocity);
serviceProviderTravelocity = appMgtclient.getApplication(SERVICE_PROVIDER_NAME_TRAVELOCITY);
InboundAuthenticationConfig inboundAuthenticationConfig = new InboundAuthenticationConfig();
InboundAuthenticationRequestConfig requestConfig = new InboundAuthenticationRequestConfig();
requestConfig.setInboundAuthKey(ISSUER_TRAVELOCITY_COM);
requestConfig.setInboundAuthType("samlsso");
Property attributeConsumerServiceIndexProp = new Property();
attributeConsumerServiceIndexProp.setName("attrConsumServiceIndex");
attributeConsumerServiceIndexProp.setValue("1239245949");
requestConfig.setProperties(new Property[] { attributeConsumerServiceIndexProp });
inboundAuthenticationConfig.setInboundAuthenticationRequestConfigs(new InboundAuthenticationRequestConfig[] { requestConfig });
serviceProviderTravelocity.setInboundAuthenticationConfig(inboundAuthenticationConfig);
RequestPathAuthenticatorConfig requestPathAuthenticatorConfig = new RequestPathAuthenticatorConfig();
requestPathAuthenticatorConfig.setName("BasicAuthRequestPathAuthenticator");
serviceProviderTravelocity.setRequestPathAuthenticatorConfigs(new RequestPathAuthenticatorConfig[] { requestPathAuthenticatorConfig });
appMgtclient.updateApplicationData(serviceProviderTravelocity);
serviceProviderTravelocity = appMgtclient.getApplication(SERVICE_PROVIDER_NAME_TRAVELOCITY);
serviceProviderAvis = new ServiceProvider();
serviceProviderAvis.setApplicationName(SERVICE_PROVIDER_NAME_AVIS);
serviceProviderAvis.setDescription(SERVICE_PROVIDER_DESC);
appMgtclient.createApplication(serviceProviderAvis);
serviceProviderAvis = appMgtclient.getApplication(SERVICE_PROVIDER_NAME_AVIS);
inboundAuthenticationConfig = new InboundAuthenticationConfig();
requestConfig = new InboundAuthenticationRequestConfig();
requestConfig.setInboundAuthKey(ISSUER_AVIS_COM);
requestConfig.setInboundAuthType("samlsso");
attributeConsumerServiceIndexProp = new Property();
attributeConsumerServiceIndexProp.setName("attrConsumServiceIndex");
attributeConsumerServiceIndexProp.setValue("1239245949");
requestConfig.setProperties(new Property[] { attributeConsumerServiceIndexProp });
inboundAuthenticationConfig.setInboundAuthenticationRequestConfigs(new InboundAuthenticationRequestConfig[] { requestConfig });
serviceProviderAvis.setInboundAuthenticationConfig(inboundAuthenticationConfig);
appMgtclient.updateApplicationData(serviceProviderAvis);
serviceProviderAvis = appMgtclient.getApplication(SERVICE_PROVIDER_NAME_AVIS);
}
Aggregations