Search in sources :

Example 1 with LoginLogoutClient

use of org.wso2.carbon.integration.common.utils.LoginLogoutClient 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 LoginLogoutClient

use of org.wso2.carbon.integration.common.utils.LoginLogoutClient in project product-is by wso2.

the class OAuth2ServiceClientCredentialTestCase 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();
}
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) RemoteUserStoreManagerServiceClient(org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with LoginLogoutClient

use of org.wso2.carbon.integration.common.utils.LoginLogoutClient in project product-is by wso2.

the class Oauth2OPIframeTestCase 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 = new DefaultHttpClient();
}
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) RemoteUserStoreManagerServiceClient(org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with LoginLogoutClient

use of org.wso2.carbon.integration.common.utils.LoginLogoutClient in project product-is by wso2.

the class ISIntegrationTest method init.

protected void init(String instance, String domainKey, String userKey) throws Exception {
    isServer = new AutomationContext("IDENTITY", instance, domainKey, userKey);
    loginLogoutClient = new LoginLogoutClient(isServer);
    sessionCookie = loginLogoutClient.login();
    backendURL = isServer.getContextUrls().getBackEndUrl();
}
Also used : AutomationContext(org.wso2.carbon.automation.engine.context.AutomationContext) LoginLogoutClient(org.wso2.carbon.integration.common.utils.LoginLogoutClient)

Example 5 with LoginLogoutClient

use of org.wso2.carbon.integration.common.utils.LoginLogoutClient in project product-is by wso2.

the class SCIM2MeTestCase method assignUserToGroup.

private void assignUserToGroup(String username) throws Exception {
    AutomationContext automationContext;
    if (tenant.equals(org.wso2.carbon.base.MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
        automationContext = new AutomationContext("IDENTITY", TestUserMode.SUPER_TENANT_ADMIN);
    } else {
        automationContext = new AutomationContext("IDENTITY", TestUserMode.TENANT_ADMIN);
    }
    String backendUrl = automationContext.getContextUrls().getBackEndUrl();
    String sessionCookie = new LoginLogoutClient(automationContext).login();
    UserManagementClient userMgtClient = new UserManagementClient(backendUrl, sessionCookie);
    String[] roles = { ADMIN_ROLE };
    userMgtClient.addRemoveRolesOfUser(username, roles, null);
}
Also used : AutomationContext(org.wso2.carbon.automation.engine.context.AutomationContext) LoginLogoutClient(org.wso2.carbon.integration.common.utils.LoginLogoutClient) UserManagementClient(org.wso2.carbon.integration.common.admin.client.UserManagementClient)

Aggregations

LoginLogoutClient (org.wso2.carbon.integration.common.utils.LoginLogoutClient)18 BeforeClass (org.testng.annotations.BeforeClass)10 AutomationContext (org.wso2.carbon.automation.engine.context.AutomationContext)10 AuthenticatorClient (org.wso2.carbon.integration.common.admin.client.AuthenticatorClient)6 ApplicationManagementServiceClient (org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient)6 OauthAdminClient (org.wso2.identity.integration.common.clients.oauth.OauthAdminClient)6 RemoteUserStoreManagerServiceClient (org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)6 Test (org.testng.annotations.Test)3 UserManagementClient (org.wso2.identity.integration.common.clients.UserManagementClient)3 ClaimMetadataManagementServiceClient (org.wso2.identity.integration.common.clients.claim.metadata.mgt.ClaimMetadataManagementServiceClient)3 File (java.io.File)2 DefaultHttpClient (org.apache.http.impl.client.DefaultHttpClient)2 ClaimDialectDTO (org.wso2.carbon.identity.claim.metadata.mgt.stub.dto.ClaimDialectDTO)2 UserManagementClient (org.wso2.carbon.integration.common.admin.client.UserManagementClient)2 ServerConfigurationManager (org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager)2 SCIM2BaseTest (org.wso2.identity.integration.test.scim2.rest.api.SCIM2BaseTest)2 HttpResponse (org.apache.http.HttpResponse)1 HttpPatch (org.apache.http.client.methods.HttpPatch)1 HttpPost (org.apache.http.client.methods.HttpPost)1 StringEntity (org.apache.http.entity.StringEntity)1