use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.
the class OIDCIdentityFederationTestCase method deleteAddedUsersInSecondaryIS.
private void deleteAddedUsersInSecondaryIS() throws RemoteException, UserAdminUserAdminException {
UserManagementClient usrMgtClient = new UserManagementClient(getSecondaryISURI(), "admin", "admin");
usrMgtClient.deleteUser(SECONDARY_IS_TEST_USERNAME);
}
use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.
the class JustInTimeProvisioningTestCase method initTest.
@BeforeClass(alwaysRun = true)
public void initTest() throws Exception {
try {
super.initTest();
backendURL = context.getContextUrls().getBackEndUrl();
logManger = new AuthenticatorClient(backendURL);
sessionCookie = logManger.login(username, userPassword, context.getInstance().getHosts().get("default"));
userMgtClient = new UserManagementClient(backendURL, sessionCookie);
userStoreClient = new RemoteUserStoreManagerServiceClient(backendURL, sessionCookie);
userStoreConfigAdminServiceClient = new UserStoreConfigAdminServiceClient(backendURL, sessionCookie);
RemoteAuthorizationManagerServiceClient remoteAuthorizationManagerServiceClient = new RemoteAuthorizationManagerServiceClient(backendURL, sessionCookie);
log.info("login user name : " + username);
log.info("login password : " + userPassword);
for (String role : userStoreClient.getRoleListOfUser(username)) {
boolean roleAuthorized = remoteAuthorizationManagerServiceClient.isRoleAuthorized(role, "/permission/admin/manage/identity/rolemgt/create", "ui.execute");
log.info("Role Authorization :" + roleAuthorized + " role: " + role);
}
boolean isUserAuthorized = remoteAuthorizationManagerServiceClient.isUserAuthorized(username, "/permission" + "/admin/manage/identity/rolemgt/create", "ui.execute");
log.info("User Authorization :" + isUserAuthorized);
remoteAuthorizationManagerServiceClient.authorizeUser(username, "/permission/admin/", "ui.execute");
boolean isAuthorized = remoteAuthorizationManagerServiceClient.isUserAuthorized(username, "/permission" + "/admin/manage/identity/rolemgt/create", "ui.execute");
log.info("User Authorization details :" + isAuthorized);
userMgtClient.addInternalRole("loginJIT", null, new String[] { "/permission/admin/login" });
addSecondaryUserStore();
} catch (Exception e) {
log.error("Failure occured due to :" + e.getMessage(), e);
throw e;
}
}
use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.
the class IdentityProviderManagementTestCase method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init();
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
identityProviderMgtServiceClient = new IdentityProviderMgtServiceClient(sessionCookie, backendURL, configContext);
userMgtClient = new UserManagementClient(backendURL, getSessionCookie());
userMgtClient.addRole("umRole1", null, new String[] { "login" }, false);
}
use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.
the class OAuthAdminServiceTestCase method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init();
logManger = new AuthenticatorClient(backendURL);
userMgtClient = new UserManagementClient(backendURL, sessionCookie);
// create a user with capital letters in user name
userMgtClient.addUser(userName, password, null, "default");
String[] userList = new String[] { userName };
FlaggedName[] userFlagList = new FlaggedName[userList.length];
for (int i = 0; i < userFlagList.length; i++) {
FlaggedName flaggedName = new FlaggedName();
flaggedName.setItemName(userList[i]);
flaggedName.setSelected(true);
userFlagList[i] = flaggedName;
}
userMgtClient.updateUsersOfRole("admin", userFlagList);
String cookie = this.logManger.login(userName, password, isServer.getInstance().getHosts().get("default"));
adminClient = new OauthAdminClient(backendURL, cookie);
}
Aggregations