Search in sources :

Example 1 with IdentityProviderMgtServiceClient

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);
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) IdentityProvider(org.wso2.carbon.identity.application.common.model.idp.xsd.IdentityProvider) IdentityProviderMgtServiceClient(org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with IdentityProviderMgtServiceClient

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));
            }
        }
    }
}
Also used : OauthAdminClient(org.wso2.identity.integration.common.clients.oauth.OauthAdminClient) ConfigurationContext(org.apache.axis2.context.ConfigurationContext) IdentityConstants(org.wso2.identity.integration.test.utils.IdentityConstants) AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) SAMLSSOConfigServiceClient(org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient) IdentityProviderMgtServiceClient(org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient)

Example 3 with IdentityProviderMgtServiceClient

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);
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) org.wso2.carbon.identity.application.common.model.xsd(org.wso2.carbon.identity.application.common.model.xsd) IdentityProviderMgtServiceClient(org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient)

Example 4 with IdentityProviderMgtServiceClient

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();
}
Also used : AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) IdentityProviderMgtServiceClient(org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with IdentityProviderMgtServiceClient

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);
}
Also used : OauthAdminClient(org.wso2.identity.integration.common.clients.oauth.OauthAdminClient) UserProfileMgtServiceClient(org.wso2.identity.integration.common.clients.UserProfileMgtServiceClient) ExternalClaimDTO(org.wso2.carbon.identity.claim.metadata.mgt.stub.dto.ExternalClaimDTO) ClaimMetadataManagementServiceClient(org.wso2.identity.integration.common.clients.claim.metadata.mgt.ClaimMetadataManagementServiceClient) OAuthConsumerAppDTO(org.wso2.carbon.identity.oauth.stub.dto.OAuthConsumerAppDTO) UserManagementClient(org.wso2.carbon.integration.common.admin.client.UserManagementClient) IdentityProviderMgtServiceClient(org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

IdentityProviderMgtServiceClient (org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient)22 BeforeClass (org.testng.annotations.BeforeClass)15 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)11 AuthenticatorClient (org.wso2.carbon.integration.common.admin.client.AuthenticatorClient)7 ApplicationManagementServiceClient (org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient)7 SAMLSSOConfigServiceClient (org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient)5 IdentityProvider (org.wso2.carbon.identity.application.common.model.idp.xsd.IdentityProvider)4 UserManagementClient (org.wso2.identity.integration.common.clients.UserManagementClient)4 OauthAdminClient (org.wso2.identity.integration.common.clients.oauth.OauthAdminClient)4 RemoteUserStoreManagerServiceClient (org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)4 BasicCookieStore (org.apache.http.impl.client.BasicCookieStore)3 Test (org.testng.annotations.Test)3 UserProfileMgtServiceClient (org.wso2.identity.integration.common.clients.UserProfileMgtServiceClient)3 XPathExpressionException (javax.xml.xpath.XPathExpressionException)2 Property (org.wso2.carbon.identity.application.common.model.idp.xsd.Property)2 CharonException (org.wso2.charon.core.exceptions.CharonException)2 ISIntegrationTest (org.wso2.identity.integration.common.utils.ISIntegrationTest)2 IdentityProviderMgtServiceClient (org.wso2.identity.scenarios.commons.clients.Idp.IdentityProviderMgtServiceClient)2 OpenApiInteractionValidator (com.atlassian.oai.validator.OpenApiInteractionValidator)1 OpenApiValidationFilter (com.atlassian.oai.validator.restassured.OpenApiValidationFilter)1