Search in sources :

Example 6 with UserManagementClient

use of org.wso2.identity.scenarios.commons.clients.UserManagementClient 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 7 with UserManagementClient

use of org.wso2.identity.scenarios.commons.clients.UserManagementClient 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)

Example 8 with UserManagementClient

use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.

the class UserSessionTest method testInitData.

@BeforeClass(alwaysRun = true)
public void testInitData() throws Exception {
    appMgtclient = new ApplicationManagementServiceClient(sessionCookie, backendURL, null);
    userMgtClient = new UserManagementClient(backendURL, sessionCookie);
    ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
    isURL = backendURL.substring(0, backendURL.indexOf("services/"));
    serviceProviderTravelocity = createServiceProvider(ISSUER_TRAVELOCITY_COM, SERVICE_PROVIDER_NAME_TRAVELOCITY);
    serviceProviderAvis = createServiceProvider(ISSUER_AVIS_COM, SERVICE_PROVIDER_NAME_AVIS);
    createUsersForTesting();
    createSessionsForTesting();
}
Also used : ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) SAMLSSOConfigServiceClient(org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient) UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 9 with UserManagementClient

use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.

the class SAMLIdentityFederationTestCase method deleteAddedUsers.

private void deleteAddedUsers() throws RemoteException, UserAdminUserAdminException {
    UserManagementClient usrMgtClient = new UserManagementClient(getSecondaryISURI(), "admin", "admin");
    usrMgtClient.deleteUser(usrName);
}
Also used : UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient)

Example 10 with UserManagementClient

use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.

the class SAMLIdentityFederationTestCase method addUserToSecondaryIS.

private boolean addUserToSecondaryIS() throws Exception {
    UserManagementClient usrMgtClient = new UserManagementClient(getSecondaryISURI(), "admin", "admin");
    if (usrMgtClient == null) {
        return false;
    } else {
        String[] roles = { usrRole };
        usrMgtClient.addUser(usrName, usrPwd, roles, null);
        if (usrMgtClient.userNameExists(usrRole, usrName)) {
            return true;
        } else {
            return false;
        }
    }
}
Also used : UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient)

Aggregations

UserManagementClient (org.wso2.identity.integration.common.clients.UserManagementClient)47 BeforeClass (org.testng.annotations.BeforeClass)30 AuthenticatorClient (org.wso2.carbon.integration.common.admin.client.AuthenticatorClient)19 File (java.io.File)8 Test (org.testng.annotations.Test)8 ISIntegrationTest (org.wso2.identity.integration.common.utils.ISIntegrationTest)8 ServerConfigurationManager (org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager)7 SetEnvironment (org.wso2.carbon.automation.engine.annotations.SetEnvironment)6 UserProfileMgtServiceClient (org.wso2.identity.integration.common.clients.UserProfileMgtServiceClient)6 RemoteUserStoreManagerServiceClient (org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)6 LoginLogoutClient (org.wso2.carbon.integration.common.utils.LoginLogoutClient)5 IdentityProviderMgtServiceClient (org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient)5 ApplicationManagementServiceClient (org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient)4 AfterClass (org.testng.annotations.AfterClass)3 AutomationContext (org.wso2.carbon.automation.engine.context.AutomationContext)3 UserManagementClient (org.wso2.carbon.integration.common.admin.client.UserManagementClient)3 UserInformationRecoveryServiceClient (org.wso2.identity.integration.common.clients.mgt.UserInformationRecoveryServiceClient)3 UserStoreConfigAdminServiceClient (org.wso2.identity.integration.common.clients.user.store.config.UserStoreConfigAdminServiceClient)3 UserManagementClient (org.wso2.identity.scenarios.commons.clients.UserManagementClient)3 XPathExpressionException (javax.xml.xpath.XPathExpressionException)2