Search in sources :

Example 36 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig in project product-is by wso2.

the class SAMLLocalAndOutboundAuthenticatorsTestCase method createAdvanceAuthenticatorWithMultiOptions.

/**
 * Create the AdvancedAuthenticator with Multi options.
 * Use any attributes needed if needed to do multiple tests with different advanced authenticators.
 * @throws Exception
 */
private void createAdvanceAuthenticatorWithMultiOptions() throws Exception {
    LocalAndOutboundAuthenticationConfig localAndOutboundAuthenticationConfig = new LocalAndOutboundAuthenticationConfig();
    AuthenticationStep authenticationStep = new AuthenticationStep();
    authenticationStep.setStepOrder(1);
    LocalAuthenticatorConfig localConfig = new LocalAuthenticatorConfig();
    localConfig.setName(CommonConstants.BASIC_AUTHENTICATOR);
    localConfig.setDisplayName("basicauth");
    localConfig.setEnabled(true);
    authenticationStep.setLocalAuthenticatorConfigs(new LocalAuthenticatorConfig[] { localConfig });
    authenticationStep.setFederatedIdentityProviders(new org.wso2.carbon.identity.application.common.model.xsd.IdentityProvider[] { getFederatedGoogleIDP() });
    authenticationStep.setSubjectStep(true);
    authenticationStep.setAttributeStep(true);
    localAndOutboundAuthenticationConfig.addAuthenticationSteps(authenticationStep);
    config.getAuthenticator().setLocalAndOutboundAuthenticationConfig(localAndOutboundAuthenticationConfig);
}
Also used : LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig) LocalAuthenticatorConfig(org.wso2.carbon.identity.application.common.model.xsd.LocalAuthenticatorConfig) AuthenticationStep(org.wso2.carbon.identity.application.common.model.xsd.AuthenticationStep)

Example 37 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig in project product-is by wso2.

the class ConditionalAuthenticationTestCase method updateAuthScript.

/**
 * Update service provider authentication script config.
 *
 * @param filename File Name of the authentication script.
 * @throws Exception
 */
private void updateAuthScript(String filename) throws Exception {
    LocalAndOutboundAuthenticationConfig outboundAuthConfig = createLocalAndOutboundAuthenticationConfig();
    outboundAuthConfig.setEnableAuthorization(true);
    String script = getConditionalAuthScript(filename);
    AuthenticationScriptConfig config = new AuthenticationScriptConfig();
    config.setContent(script);
    config.setEnabled(true);
    outboundAuthConfig.setAuthenticationScriptConfig(config);
    serviceProvider.setLocalAndOutBoundAuthenticationConfig(outboundAuthConfig);
    applicationManagementServiceClient.updateApplicationData(serviceProvider);
}
Also used : LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig) AuthenticationScriptConfig(org.wso2.carbon.identity.application.common.model.script.xsd.AuthenticationScriptConfig)

Example 38 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig in project product-is by wso2.

the class ConditionalAuthenticationTestCase method createLocalAndOutboundAuthenticationConfig.

protected LocalAndOutboundAuthenticationConfig createLocalAndOutboundAuthenticationConfig() throws Exception {
    LocalAndOutboundAuthenticationConfig localAndOutboundAuthenticationConfig = super.createLocalAndOutboundAuthenticationConfig();
    AuthenticationStep authenticationStep2 = new AuthenticationStep();
    authenticationStep2.setStepOrder(2);
    authenticationStep2.setSubjectStep(false);
    authenticationStep2.setAttributeStep(false);
    authenticationStep2.setFederatedIdentityProviders(new org.wso2.carbon.identity.application.common.model.xsd.IdentityProvider[] { getFederatedSAMLSSOIDP() });
    localAndOutboundAuthenticationConfig.addAuthenticationSteps(authenticationStep2);
    return localAndOutboundAuthenticationConfig;
}
Also used : LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig) AuthenticationStep(org.wso2.carbon.identity.application.common.model.xsd.AuthenticationStep)

Example 39 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig in project product-is by wso2.

the class AbstractApplicationAuthzTestCase method createApplication.

protected void createApplication(String applicationName) throws Exception {
    ServiceProvider serviceProvider = new ServiceProvider();
    serviceProvider.setApplicationName(applicationName);
    serviceProvider.setDescription("This is a test Service Provider for AZ test");
    applicationManagementServiceClient.createApplication(serviceProvider);
    serviceProvider = applicationManagementServiceClient.getApplication(applicationName);
    InboundAuthenticationRequestConfig requestConfig = new InboundAuthenticationRequestConfig();
    requestConfig.setInboundAuthType(INBOUND_AUTH_TYPE);
    requestConfig.setInboundAuthKey(applicationName);
    InboundAuthenticationConfig inboundAuthenticationConfig = new InboundAuthenticationConfig();
    inboundAuthenticationConfig.setInboundAuthenticationRequestConfigs(new InboundAuthenticationRequestConfig[] { requestConfig });
    serviceProvider.setInboundAuthenticationConfig(inboundAuthenticationConfig);
    LocalAndOutboundAuthenticationConfig outboundAuthConfig = new LocalAndOutboundAuthenticationConfig();
    outboundAuthConfig.setEnableAuthorization(true);
    serviceProvider.setLocalAndOutBoundAuthenticationConfig(outboundAuthConfig);
    applicationManagementServiceClient.updateApplicationData(serviceProvider);
}
Also used : LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig) InboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig) ServiceProvider(org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider) InboundAuthenticationRequestConfig(org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig)

Example 40 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig in project product-is by wso2.

the class OIDCSPWiseSkipLoginConsentTestCase method configureSPToSkipConsent.

private void configureSPToSkipConsent() throws Exception {
    OIDCApplication oidcApplication = OIDCUtilTest.applications.get(OIDCUtilTest.playgroundAppTwoAppName);
    ServiceProvider serviceProvider = appMgtclient.getApplication(oidcApplication.getApplicationName());
    LocalAndOutboundAuthenticationConfig localAndOutboundAuthenticationConfig = new LocalAndOutboundAuthenticationConfig();
    localAndOutboundAuthenticationConfig.setSkipConsent(true);
    serviceProvider.setLocalAndOutBoundAuthenticationConfig(localAndOutboundAuthenticationConfig);
    appMgtclient.updateApplicationData(serviceProvider);
}
Also used : LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig) ServiceProvider(org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider) OIDCApplication(org.wso2.identity.integration.test.oidc.bean.OIDCApplication)

Aggregations

LocalAndOutboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig)24 LocalAndOutboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig)13 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)12 AuthenticationStep (org.wso2.carbon.identity.application.common.model.AuthenticationStep)8 ClaimConfig (org.wso2.carbon.identity.application.common.model.ClaimConfig)7 AuthenticationStep (org.wso2.carbon.identity.application.common.model.xsd.AuthenticationStep)7 PreparedStatement (java.sql.PreparedStatement)6 ArrayList (java.util.ArrayList)6 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)6 Test (org.testng.annotations.Test)6 IdentityProvider (org.wso2.carbon.identity.application.common.model.IdentityProvider)6 LocalAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.xsd.LocalAuthenticatorConfig)6 NamedPreparedStatement (org.wso2.carbon.database.utils.jdbc.NamedPreparedStatement)5 IdentityApplicationManagementException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)5 ResultSet (java.sql.ResultSet)4 LocalAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.LocalAuthenticatorConfig)4 User (org.wso2.carbon.identity.application.common.model.User)4 InboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig)4 InboundAuthenticationRequestConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig)4 ApplicationConfig (org.wso2.carbon.identity.application.authentication.framework.config.model.ApplicationConfig)3