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);
}
}
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);
}
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);
}
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);
}
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");
}
Aggregations