Search in sources :

Example 1 with IdentityGovernanceServiceClient

use of org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient in project product-is by wso2.

the class OAuth2ServiceResourceOwnerTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    backendURL = context.getContextUrls().getBackEndUrl();
    loginLogoutClient = new LoginLogoutClient(context);
    logManger = new AuthenticatorClient(backendURL);
    sessionCookie = logManger.login(username, userPassword, context.getInstance().getHosts().get("default"));
    identityContextUrls = context.getContextUrls();
    tenantInfo = context.getContextTenant();
    userInfo = tenantInfo.getContextUser();
    appMgtclient = new ApplicationManagementServiceClient(sessionCookie, backendURL, null);
    adminClient = new OauthAdminClient(backendURL, sessionCookie);
    remoteUSMServiceClient = new RemoteUserStoreManagerServiceClient(backendURL, sessionCookie);
    setSystemproperties();
    client = HttpClientBuilder.create().build();
    identityGovernanceServiceClient = new IdentityGovernanceServiceClient(sessionCookie, backendURL);
    createLockedUser(lockedUser, lockedUserPassword);
}
Also used : OauthAdminClient(org.wso2.identity.integration.common.clients.oauth.OauthAdminClient) LoginLogoutClient(org.wso2.carbon.integration.common.utils.LoginLogoutClient) AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) IdentityGovernanceServiceClient(org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient) RemoteUserStoreManagerServiceClient(org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with IdentityGovernanceServiceClient

use of org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient in project product-is by wso2.

the class AdminForcedPasswordResetTestCase method selectPasswordResetOption.

protected void selectPasswordResetOption(String option) throws Exception {
    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[3];
    Property prop = new Property();
    prop.setName(option);
    prop.setValue(TRUE_STRING);
    Property prop1 = new Property();
    prop1.setName(ENABLE_ADMIN_PASSWORD_RESET_WITH_RECOVERY_LINK);
    prop1.setValue("false");
    Property prop2 = new Property();
    prop2.setName(ENABLE_NOTIFICATION_BASED_PASSWORD_RECOVERY);
    prop2.setValue(TRUE_STRING);
    newProperties[0] = prop;
    newProperties[1] = prop1;
    newProperties[2] = prop2;
    identityGovernanceServiceClient.updateConfigurations(newProperties);
}
Also used : IdentityGovernanceServiceClient(org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient) Property(org.wso2.carbon.identity.governance.stub.bean.Property)

Example 3 with IdentityGovernanceServiceClient

use of org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient in project product-is by wso2.

the class AccountLockEnabledTestCase method enableAccountLocking.

protected void enableAccountLocking(String option) throws Exception {
    identityGovernanceServiceClient = new IdentityGovernanceServiceClient(sessionCookie, backendURL);
    Thread.sleep(5000);
    authenticatorClient.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(option);
    prop.setValue(TRUE_STRING);
    newProperties[0] = prop;
    identityGovernanceServiceClient.updateConfigurations(newProperties);
}
Also used : IdentityGovernanceServiceClient(org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient) Property(org.wso2.carbon.identity.governance.stub.bean.Property)

Example 4 with IdentityGovernanceServiceClient

use of org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient in project product-is by wso2.

the class IdentityGovernanceTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    identityGovernanceServiceClient = new IdentityGovernanceServiceClient(sessionCookie, backendURL);
}
Also used : IdentityGovernanceServiceClient(org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with IdentityGovernanceServiceClient

use of org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient 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)

Aggregations

IdentityGovernanceServiceClient (org.wso2.identity.integration.common.clients.mgt.IdentityGovernanceServiceClient)5 BeforeClass (org.testng.annotations.BeforeClass)3 Property (org.wso2.carbon.identity.governance.stub.bean.Property)3 AuthenticatorClient (org.wso2.carbon.integration.common.admin.client.AuthenticatorClient)2 RemoteUserStoreManagerServiceClient (org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)2 SetEnvironment (org.wso2.carbon.automation.engine.annotations.SetEnvironment)1 LoginLogoutClient (org.wso2.carbon.integration.common.utils.LoginLogoutClient)1 UserManagementClient (org.wso2.identity.integration.common.clients.UserManagementClient)1 ApplicationManagementServiceClient (org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient)1 OauthAdminClient (org.wso2.identity.integration.common.clients.oauth.OauthAdminClient)1