use of org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient in project product-is by wso2.
the class ResidentIDPConfigsTestCase method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
AuthenticatorClient loginManger = new AuthenticatorClient(backendURL);
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
String cookie = loginManger.login(username, userPassword, isServer.getInstance().getHosts().get("default"));
idpMgtServiceClient = new IdentityProviderMgtServiceClient(cookie, isServer.getContextUrls().getBackEndUrl(), configContext);
IdentityProvider idProvider = idpMgtServiceClient.getResidentIdP();
log.info("Retrieving resident identity provider");
fedAuthConfigMap = getFedAuthConfigMap(idProvider);
provisioningConfigMap = getProvisioningConfigMap(idProvider);
}
use of org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient 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.Idp.IdentityProviderMgtServiceClient in project product-is by wso2.
the class ApplicationManagementTestCase method createIdp.
private void createIdp(IdentityProvider idp) throws Exception {
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
IdentityProviderMgtServiceClient identityProviderMgtServiceClient = new IdentityProviderMgtServiceClient(sessionCookie, backendURL, configContext);
org.wso2.carbon.identity.application.common.model.idp.xsd.IdentityProvider identityProvider = new org.wso2.carbon.identity.application.common.model.idp.xsd.IdentityProvider();
identityProvider.setIdentityProviderName(idp.getIdentityProviderName());
org.wso2.carbon.identity.application.common.model.idp.xsd.FederatedAuthenticatorConfig federatedAuthenticatorConfig = new org.wso2.carbon.identity.application.common.model.idp.xsd.FederatedAuthenticatorConfig();
federatedAuthenticatorConfig.setName(idp.getDefaultAuthenticatorConfig().getName());
federatedAuthenticatorConfig.setEnabled(idp.getDefaultAuthenticatorConfig().getEnabled());
identityProvider.setFederatedAuthenticatorConfigs(new org.wso2.carbon.identity.application.common.model.idp.xsd.FederatedAuthenticatorConfig[] { federatedAuthenticatorConfig });
identityProvider.setDefaultAuthenticatorConfig(federatedAuthenticatorConfig);
identityProviderMgtServiceClient.addIdP(identityProvider);
}
use of org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient in project product-is by wso2.
the class SelfSignUpConsentTest method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init();
secondaryTenantDomain = isServer.getTenantList().get(1);
tenantAdminUserName = ADMIN + "@" + secondaryTenantDomain;
this.logManager = new AuthenticatorClient(backendURL);
String tenantCookie = this.logManager.login(ADMIN + "@" + secondaryTenantDomain, ADMIN, isServer.getInstance().getHosts().get("default"));
superTenantIDPMgtClient = new IdentityProviderMgtServiceClient(sessionCookie, backendURL);
tenantIDPMgtClient = new IdentityProviderMgtServiceClient(tenantCookie, backendURL);
tenantUserMgtClient = new UserManagementClient(backendURL, tenantCookie);
isServerBackendUrl = isServer.getContextUrls().getWebAppURLHttps();
consentEndpoint = isServerBackendUrl + "/t/" + secondaryTenantDomain + CONSNT_ENDPOINT_SUFFIX;
selfRegisterDoEndpoint = isServerBackendUrl + "/accountrecoveryendpoint/register.do";
signupDoEndpoint = isServerBackendUrl + "/accountrecoveryendpoint/signup.do";
selfRegistrationMeEndpoint = isServerBackendUrl + "/t/" + secondaryTenantDomain + USER_RECOVERY_ME_ENDPOINT;
superTenantResidentIDP = superTenantIDPMgtClient.getResidentIdP();
tenantResidentIDP = tenantIDPMgtClient.getResidentIdP();
}
use of org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient in project product-is by wso2.
the class OAuth2ServiceJWTGrantTestCase method setup.
@BeforeClass
public void setup() throws Exception {
super.init(TestUserMode.SUPER_TENANT_ADMIN);
changeISConfiguration("jwt_token_issuer_enabled.toml");
super.init(TestUserMode.SUPER_TENANT_ADMIN);
OAuthConsumerAppDTO appDto = createApplication(createApplicationWithJWTGrantType());
consumerKey = appDto.getOauthConsumerKey();
consumerSecret = appDto.getOauthConsumerSecret();
userManagementClient = new UserManagementClient(backendURL, sessionCookie);
oauthAdminClient = new OauthAdminClient(backendURL, sessionCookie);
userProfileMgtServiceClient = new UserProfileMgtServiceClient(backendURL, sessionCookie);
identityProviderMgtServiceClient = new IdentityProviderMgtServiceClient(sessionCookie, backendURL);
addNewUserWithClaims();
claimMetadataManagementServiceClient = new ClaimMetadataManagementServiceClient(backendURL, sessionCookie);
changeCountryOIDDialect();
ExternalClaimDTO externalClaimDTO = new ExternalClaimDTO();
externalClaimDTO.setExternalClaimDialectURI(OAuth2ServiceAuthCodeGrantOpenIdRequestObjectTestCase.OIDC_CLAIM_DIALECT);
externalClaimDTO.setMappedLocalClaimURI(COUNTRY_LOCAL_CLAIM_URI);
externalClaimDTO.setExternalClaimURI(COUNTRY_NEW_OIDC_CLAIM);
claimMetadataManagementServiceClient.addExternalClaim(externalClaimDTO);
String[] openidValue = new String[1];
openidValue[0] = COUNTRY_NEW_OIDC_CLAIM;
oauthAdminClient.updateScope(openIdScope, openidValue, null);
}
Aggregations