Search in sources :

Example 41 with UserManagementClient

use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.

the class ReadOnlyUserStoreInitializerTestCase method resetUserStoreConfig.

@AfterTest(alwaysRun = true)
public void resetUserStoreConfig() throws Exception {
    scm.restoreToLastConfiguration(true);
    super.init(TestUserMode.SUPER_TENANT_ADMIN);
    userMgtClient = new UserManagementClient(backendURL, getSessionCookie());
    if (ISTestUtils.nameExists(userMgtClient.listAllUsers(newUserName, 10), newUserName)) {
        userMgtClient.deleteUser(newUserName);
    }
    if (userMgtClient.roleNameExists(newUserRole)) {
        userMgtClient.deleteRole(newUserRole);
    }
}
Also used : UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) AfterTest(org.testng.annotations.AfterTest)

Example 42 with UserManagementClient

use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.

the class AdminForcedPasswordResetTestCase method setUpUser.

protected void setUpUser() throws UserStoreException, RemoteException, RemoteUserStoreManagerServiceUserStoreExceptionException, UserAdminUserAdminException, UserProfileMgtServiceUserProfileExceptionException, LogoutAuthenticationExceptionException {
    userMgtClient = new UserManagementClient(backendURL, sessionCookie);
    remoteUSMServiceClient = new RemoteUserStoreManagerServiceClient(backendURL, sessionCookie);
    remoteUSMServiceClient.addUser(TEST_USER_USERNAME, TEST_USER_PASSWORD, null, null, PROFILE_NAME, false);
    userMgtClient.addRole(TEST_ROLE, new String[] { TEST_USER_USERNAME }, new String[] { "/permission/admin/login" }, false);
    setUserClaim(EMAIL_CLAIM, TEST_USER_EMAIL);
}
Also used : UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) RemoteUserStoreManagerServiceClient(org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)

Example 43 with UserManagementClient

use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.

the class AccountLockingWhileSCIMEnabledTestCase method testInit.

@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    String carbonHome = Utils.getResidentCarbonHome();
    identityMgtServerFile = new File(carbonHome + File.separator + "repository" + File.separator + "conf" + File.separator + "identity" + File.separator + "identity-mgt.properties");
    File identityMgtConfigFile = new File(getISResourceLocation() + File.separator + "identityMgt" + File.separator + "identity-mgt-account-lock-enabled.properties");
    userMgtServerFile = new File(carbonHome + File.separator + "repository" + File.separator + "conf" + File.separator + "user-mgt.xml");
    File scimEnabledUserMgtCofigFile = new File(getISResourceLocation() + File.separator + "userMgt" + File.separator + "scim-enabled-user-mgt.xml");
    scm = new ServerConfigurationManager(isServer);
    scm.applyConfigurationWithoutRestart(identityMgtConfigFile, identityMgtServerFile, true);
    scm.applyConfigurationWithoutRestart(scimEnabledUserMgtCofigFile, userMgtServerFile, true);
    scm.restartGracefully();
    super.init();
    loginManger = new AuthenticatorClient(backendURL);
    userMgtClient = new UserManagementClient(backendURL, sessionCookie);
    infoRecoveryClient = new UserInformationRecoveryServiceClient(backendURL, sessionCookie);
    profileClient = new UserProfileMgtServiceClient(backendURL, sessionCookie);
    loginManger.login(isServer.getSuperTenant().getTenantAdmin().getUserName(), isServer.getSuperTenant().getTenantAdmin().getPassword(), isServer.getInstance().getHosts().get("default"));
    claimMgtClient = new ClaimManagementServiceClient(backendURL, sessionCookie);
    ClaimValue[] claimValues = new ClaimValue[1];
    // Need to add this claim and have the value true in order to test the fix
    ClaimValue scimActiveClaim = new ClaimValue();
    scimActiveClaim.setClaimURI(SCIM_ACTIVE_URI);
    scimActiveClaim.setValue("true");
    claimValues[0] = scimActiveClaim;
    remoteUSMServiceClient = new RemoteUserStoreManagerServiceClient(backendURL, sessionCookie);
    remoteUSMServiceClient.addUser(TEST_USER_USERNAME, TEST_USER_PASSWORD, null, claimValues, PROFILE_NAME, false);
    userMgtClient.addRole(TEST_ROLE, new String[] { TEST_USER_USERNAME }, new String[] { "/permission/admin/login" }, false);
}
Also used : UserProfileMgtServiceClient(org.wso2.identity.integration.common.clients.UserProfileMgtServiceClient) ClaimManagementServiceClient(org.wso2.identity.integration.common.clients.ClaimManagementServiceClient) ClaimValue(org.wso2.carbon.um.ws.api.stub.ClaimValue) AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) RemoteUserStoreManagerServiceClient(org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient) File(java.io.File) UserInformationRecoveryServiceClient(org.wso2.identity.integration.common.clients.mgt.UserInformationRecoveryServiceClient) BeforeClass(org.testng.annotations.BeforeClass) SetEnvironment(org.wso2.carbon.automation.engine.annotations.SetEnvironment)

Example 44 with UserManagementClient

use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.

the class PasswordHistoryValidationTestCase method testInit.

@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    loginManger = new AuthenticatorClient(backendURL);
    userMgtClient = new UserManagementClient(backendURL, sessionCookie);
    identityGovernanceServiceClient = new IdentityGovernanceServiceClient(sessionCookie, backendURL);
    Thread.sleep(5000);
    loginManger.login(isServer.getSuperTenant().getTenantAdmin().getUserName(), isServer.getSuperTenant().getTenantAdmin().getPassword(), isServer.getInstance().getHosts().get("default"));
    Property[] newProperties = new Property[1];
    Property prop = new Property();
    prop.setName("passwordHistory.enable");
    prop.setValue("true");
    newProperties[0] = prop;
    identityGovernanceServiceClient.updateConfigurations(newProperties);
    remoteUSMServiceClient = new RemoteUserStoreManagerServiceClient(backendURL, sessionCookie);
    remoteUSMServiceClient.addUser(TEST_USER_USERNAME, TEST_USER_PASSWORD, null, null, PROFILE_NAME, false);
    userMgtClient.addRole(TEST_ROLE, new String[] { TEST_USER_USERNAME }, new String[] { "/permission/admin/login" }, false);
}
Also used : AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) IdentityGovernanceServiceClient(org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient) RemoteUserStoreManagerServiceClient(org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient) Property(org.wso2.carbon.identity.governance.stub.bean.Property) BeforeClass(org.testng.annotations.BeforeClass) SetEnvironment(org.wso2.carbon.automation.engine.annotations.SetEnvironment)

Example 45 with UserManagementClient

use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.

the class EntitlementNotificationTestCase method atEnd.

@AfterClass(alwaysRun = true)
public void atEnd() throws Exception {
    resetISConfiguration();
    super.init();
    userMgtServiceClient = new UserManagementClient(backendURL, sessionCookie);
    userMgtServiceClient.deleteUser("CREATE");
    userMgtServiceClient.deleteUser("UPDATE");
    userMgtServiceClient.deleteUser("DELETE");
}
Also used : UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) AfterClass(org.testng.annotations.AfterClass)

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