Search in sources :

Example 6 with SAMLSSOConfigServiceClient

use of org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient in project product-is by wso2.

the class ChallengeQuestionPostAuthnHandlerTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init(config.getUserMode());
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    applicationManagementServiceClient = new ApplicationManagementServiceClient(sessionCookie, backendURL, configContext);
    ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
    remoteUSMServiceClient = new RemoteUserStoreManagerServiceClient(backendURL, sessionCookie);
    createUser();
    userId = UserUtil.getUserId(config.getUser().getTenantAwareUsername(), isServer.getContextTenant());
    createApplication();
    AuthenticatorClient logManager = new AuthenticatorClient(backendURL);
    String secondaryTenantDomain = isServer.getTenantList().get(1);
    String tenantCookie = logManager.login(ADMIN + "@" + secondaryTenantDomain, ADMIN, isServer.getInstance().getHosts().get("default"));
    superTenantIDPMgtClient = new IdentityProviderMgtServiceClient(sessionCookie, backendURL);
    tenantIDPMgtClient = new IdentityProviderMgtServiceClient(tenantCookie, backendURL);
    superTenantResidentIDP = superTenantIDPMgtClient.getResidentIdP();
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) SAMLSSOConfigServiceClient(org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient) RemoteUserStoreManagerServiceClient(org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient) IdentityProviderMgtServiceClient(org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 7 with SAMLSSOConfigServiceClient

use of org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient in project product-is by wso2.

the class UserSessionTest method testInitData.

@BeforeClass(alwaysRun = true)
public void testInitData() throws Exception {
    appMgtclient = new ApplicationManagementServiceClient(sessionCookie, backendURL, null);
    userMgtClient = new UserManagementClient(backendURL, sessionCookie);
    ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
    isURL = backendURL.substring(0, backendURL.indexOf("services/"));
    serviceProviderTravelocity = createServiceProvider(ISSUER_TRAVELOCITY_COM, SERVICE_PROVIDER_NAME_TRAVELOCITY);
    serviceProviderAvis = createServiceProvider(ISSUER_AVIS_COM, SERVICE_PROVIDER_NAME_AVIS);
    createUsersForTesting();
    createSessionsForTesting();
}
Also used : ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) SAMLSSOConfigServiceClient(org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient) UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 8 with SAMLSSOConfigServiceClient

use of org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient in project product-is by wso2.

the class SAMLErrorResponseTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init(TestUserMode.SUPER_TENANT_ADMIN);
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    applicationManagementServiceClient = new ApplicationManagementServiceClient(sessionCookie, backendURL, configContext);
    ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
    httpClient = HttpClientBuilder.create().setDefaultCookieStore(cookieStore).build();
    createApplication();
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) SAMLSSOConfigServiceClient(org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 9 with SAMLSSOConfigServiceClient

use of org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient in project product-is by wso2.

the class SAMLFederationDynamicQueryParametersTestCase method initTest.

@BeforeClass(alwaysRun = true)
public void initTest() throws Exception {
    super.initTest();
    String userName = userInfo.getUserName();
    String password = userInfo.getPassword();
    appMgtclient = new ApplicationManagementServiceClient(sessionCookie, backendURL, null);
    idpMgtClient = new IdentityProviderMgtServiceClient(userName, password, backendURL);
    ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, userName, password);
}
Also used : ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) SAMLSSOConfigServiceClient(org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient) IdentityProviderMgtServiceClient(org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 10 with SAMLSSOConfigServiceClient

use of org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient in project product-is by wso2.

the class TenantDropDownTestCase method setUp.

@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    applicationAuthenticationXml = new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "identity" + File.separator + "application-authentication.xml");
    File applicationAuthenticationXmlToCopy = new File(FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator + "IS" + File.separator + "tenantDropdown" + File.separator + "application-authentication-tanantDropdown-enabled.xml");
    authenticatorsXml = new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "security" + File.separator + "authenticators.xml");
    File authenticatorsXmlToCopy = new File(FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator + "IS" + File.separator + "tenantDropdown" + File.separator + "authenticators-tenantDropdown-enabled.xml");
    catalinaServerXml = new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "tomcat" + File.separator + "catalina-server.xml");
    File catalinaServerXmlToCopy = new File(FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator + "IS" + File.separator + "tenantDropdown" + File.separator + "catalina-server-tanantDropdown-enabled.xml");
    endpointConfigProperties = new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "identity" + File.separator + "EndpointConfig.properties");
    File endpointConfigPropertiesToCopy = new File(FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator + "IS" + File.separator + "tenantDropdown" + File.separator + "EndpointConfigTenantDropdownEnabled.properties");
    userIdentityMgt = new ServerConfigurationManager(isServer);
    userIdentityMgt.applyConfigurationWithoutRestart(applicationAuthenticationXmlToCopy, applicationAuthenticationXml, true);
    userIdentityMgt.applyConfigurationWithoutRestart(authenticatorsXmlToCopy, authenticatorsXml, true);
    userIdentityMgt.applyConfigurationWithoutRestart(catalinaServerXmlToCopy, catalinaServerXml, true);
    userIdentityMgt.applyConfigurationWithoutRestart(endpointConfigPropertiesToCopy, endpointConfigProperties, true);
    userIdentityMgt.restartGracefully();
    super.init();
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    driver = BrowserManager.getWebDriver();
    tenantServiceClient = new TenantManagementServiceClient(isServer.getContextUrls().getBackEndUrl(), sessionCookie);
    tenantServiceClient.addTenant(TENANT_DOMAIN, "admin", "password", "admin@dropdown.com", "Dropdown", "User");
    ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
    applicationManagementServiceClient = new ApplicationManagementServiceClient(sessionCookie, backendURL, configContext);
    ssoConfigServiceClient.addServiceProvider(createSsoServiceProviderDTO());
    createApplication();
    driver.get(isServer.getContextUrls().getWebAppURLHttps() + "/samlsso?spEntityID=" + SAML_ISSUER);
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) SAMLSSOConfigServiceClient(org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient) ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) File(java.io.File) TenantManagementServiceClient(org.wso2.identity.integration.common.clients.TenantManagementServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

SAMLSSOConfigServiceClient (org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient)20 ApplicationManagementServiceClient (org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient)17 BeforeClass (org.testng.annotations.BeforeClass)15 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)11 RemoteUserStoreManagerServiceClient (org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)7 AuthenticatorClient (org.wso2.carbon.integration.common.admin.client.AuthenticatorClient)6 BasicCookieStore (org.apache.http.impl.client.BasicCookieStore)5 IdentityProviderMgtServiceClient (org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient)5 InboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig)2 InboundAuthenticationRequestConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig)2 Property (org.wso2.carbon.identity.application.common.model.xsd.Property)2 RequestPathAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.xsd.RequestPathAuthenticatorConfig)2 ServiceProvider (org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider)2 ServerConfigurationManager (org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager)2 TenantManagementServiceClient (org.wso2.identity.integration.common.clients.TenantManagementServiceClient)2 EntitlementPolicyServiceClient (org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient)2 OauthAdminClient (org.wso2.identity.integration.common.clients.oauth.OauthAdminClient)2 File (java.io.File)1 DefaultHttpClient (org.apache.http.impl.client.DefaultHttpClient)1 AutomationContext (org.wso2.carbon.automation.engine.context.AutomationContext)1