use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.
the class EntitlementNotificationTestCase method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init();
changeISConfiguration();
super.init();
entitlementPolicyClient = new EntitlementPolicyServiceClient(backendURL, sessionCookie);
userMgtServiceClient = new UserManagementClient(backendURL, sessionCookie);
}
use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.
the class ApplicationManagementTestCase method testRetrieveFederatedIdPsWithLoginPermission.
@Test(alwaysRun = true, description = "Retrieve all federated IdPs with login permission")
public void testRetrieveFederatedIdPsWithLoginPermission() {
try {
String loginRole = "loginRole";
String testAssociationUser1 = "testAssociationUser1";
String testPassword1 = "testPassword1";
UserManagementClient userMgtClient = new UserManagementClient(backendURL, sessionCookie);
userMgtClient.addRole(loginRole, new String[0], new String[] { PERMISSION_ADMIN_LOGIN });
userMgtClient.addUser(testAssociationUser1, testPassword1, new String[] { loginRole }, null);
ApplicationManagementServiceClient appManageServiceClient = new ApplicationManagementServiceClient(testAssociationUser1, testPassword1, backendURL, configContext);
IdentityProvider[] idps = appManageServiceClient.getAllFederatedIdentityProvider();
Assert.assertTrue(idps != null && idps.length != 0, "Federated IdPs have been retrieved by a" + " user with login permission.");
} catch (Exception e) {
Assert.fail("Error while trying to retrieve federated idps with login permission", e);
}
}
use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.
the class OIDCFederatedIdpInitLogoutTest method addUserToSecondaryIS.
private boolean addUserToSecondaryIS() throws Exception {
UserManagementClient usrMgtClient = new UserManagementClient(getSecondaryISURI(), "admin", "admin");
if (usrMgtClient == null) {
return false;
} else {
String[] roles = { SECONDARY_IS_TEST_USER_ROLES };
usrMgtClient.addUser(SECONDARY_IS_TEST_USERNAME, SECONDARY_IS_TEST_PASSWORD, roles, null);
if (usrMgtClient.userNameExists(SECONDARY_IS_TEST_USER_ROLES, SECONDARY_IS_TEST_USERNAME)) {
return true;
} else {
return false;
}
}
}
use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.
the class OIDCFederatedIdpInitLogoutTest 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.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.
the class OIDCIdentityFederationTestCase method addUserToSecondaryIS.
/**
*TODO Test case for consent denial from the federated IdP during the logout. Implement after resolving
* {@link https://github.com/wso2/product-is/issues/10636}
*/
// @Test(groups = "wso2.is", description = "Check SAML-to-OIDC federated logout deny-consent", dependsOnMethods = {
// "testFederatedLogin"})
// public void testLogoutDenyConsent() throws Exception {
//
// sendLogoutRequestToPrimaryIS();
//
// String consentDeniedResponseToWebapp = doLogoutConsentDenyInSecondaryIS();
// Assert.assertNotNull(consentDeniedResponseToWebapp,
// "Unable to acquire logout consent deny response");
// Assert.assertTrue(consentDeniedResponseToWebapp.contains("access_denied"));
// }
private boolean addUserToSecondaryIS() throws Exception {
UserManagementClient usrMgtClient = new UserManagementClient(getSecondaryISURI(), "admin", "admin");
if (usrMgtClient == null) {
return false;
} else {
String[] roles = { SECONDARY_IS_TEST_USER_ROLES };
usrMgtClient.addUser(SECONDARY_IS_TEST_USERNAME, SECONDARY_IS_TEST_PASSWORD, roles, null);
if (usrMgtClient.userNameExists(SECONDARY_IS_TEST_USER_ROLES, SECONDARY_IS_TEST_USERNAME)) {
return true;
} else {
return false;
}
}
}
Aggregations