Search in sources :

Example 41 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.xsd.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)

Example 42 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig in project identity-api-server by wso2.

the class ServiceProviderToApiModel method buildAuthenticationSequence.

private AuthenticationSequence buildAuthenticationSequence(ServiceProvider application) {
    LocalAndOutboundAuthenticationConfig authConfig = application.getLocalAndOutBoundAuthenticationConfig();
    AuthenticationSequence.TypeEnum authenticationType = getAuthenticationType(authConfig);
    if (authenticationType == AuthenticationSequence.TypeEnum.DEFAULT) {
        // If this is the default sequence we need to set the default tenant authentication sequence.
        if (log.isDebugEnabled()) {
            log.debug("Authentication type is set to 'DEFAULT'. Reading the authentication sequence from the " + "'default' application and showing the effective authentication sequence for application " + "with id: " + application.getApplicationResourceId());
        }
        authConfig = getDefaultAuthenticationConfig();
    }
    AuthenticationSequence authSequence = new AuthenticationSequence();
    authSequence.setType(authenticationType);
    if (authConfig.getAuthenticationScriptConfig() != null) {
        authSequence.script(authConfig.getAuthenticationScriptConfig().getContent());
    }
    addAuthenticationStepInformation(authConfig, authSequence);
    List<String> requestPathAuthenticators = getRequestPathAuthenticators(application);
    authSequence.setRequestPathAuthenticators(requestPathAuthenticators);
    return authSequence;
}
Also used : LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig) AuthenticationSequence(org.wso2.carbon.identity.api.server.application.management.v1.AuthenticationSequence)

Example 43 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig in project identity-api-server by wso2.

the class ServiceProviderToApiModel method buildSubjectClaimConfig.

private SubjectConfig buildSubjectClaimConfig(ServiceProvider application) {
    SubjectConfig subjectConfig = new SubjectConfig();
    if (application.getClaimConfig() != null) {
        subjectConfig.useMappedLocalSubject(application.getClaimConfig().isAlwaysSendMappedLocalSubjectId());
    }
    LocalAndOutboundAuthenticationConfig localAndOutboundAuthConfig = application.getLocalAndOutBoundAuthenticationConfig();
    if (localAndOutboundAuthConfig != null) {
        subjectConfig.includeTenantDomain(localAndOutboundAuthConfig.isUseTenantDomainInLocalSubjectIdentifier());
        subjectConfig.includeUserDomain(localAndOutboundAuthConfig.isUseUserstoreDomainInLocalSubjectIdentifier());
        if (StringUtils.isBlank(localAndOutboundAuthConfig.getSubjectClaimUri())) {
            if (isLocalClaimDialectUsedBySp(application)) {
                subjectConfig.claim(buildClaimModel(FrameworkConstants.USERNAME_CLAIM));
            }
        } else {
            subjectConfig.claim(buildClaimModel(localAndOutboundAuthConfig.getSubjectClaimUri()));
        }
    }
    return subjectConfig;
}
Also used : SubjectConfig(org.wso2.carbon.identity.api.server.application.management.v1.SubjectConfig) LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig)

Example 44 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig in project identity-api-server by wso2.

the class UpdateAdvancedConfigurations method apply.

@Override
public void apply(ServiceProvider serviceProvider, AdvancedApplicationConfiguration advancedConfigurations) {
    if (advancedConfigurations != null) {
        setIfNotNull(advancedConfigurations.getSaas(), serviceProvider::setSaasApp);
        setIfNotNull(advancedConfigurations.getDiscoverableByEndUsers(), serviceProvider::setDiscoverable);
        LocalAndOutboundAuthenticationConfig config = getLocalAndOutboundConfig(serviceProvider);
        setIfNotNull(advancedConfigurations.getSkipLoginConsent(), config::setSkipConsent);
        setIfNotNull(advancedConfigurations.getSkipLogoutConsent(), config::setSkipLogoutConsent);
        setIfNotNull(advancedConfigurations.getReturnAuthenticatedIdpList(), config::setAlwaysSendBackAuthenticatedListOfIdPs);
        setIfNotNull(advancedConfigurations.getEnableAuthorization(), config::setEnableAuthorization);
        updateCertificate(advancedConfigurations.getCertificate(), serviceProvider);
    }
}
Also used : LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig)

Example 45 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig in project identity-api-server by wso2.

the class UpdateClaimConfiguration method updateRoleClaimConfigs.

private void updateRoleClaimConfigs(RoleConfig roleApiModel, ServiceProvider application) {
    if (roleApiModel != null) {
        ClaimConfig claimConfig = getClaimConfig(application);
        if (roleApiModel.getClaim() != null) {
            claimConfig.setRoleClaimURI(roleApiModel.getClaim().getUri());
        }
        PermissionsAndRoleConfig permissionAndRoleConfig = getPermissionAndRoleConfig(application);
        permissionAndRoleConfig.setRoleMappings(getRoleMappings(roleApiModel));
        LocalAndOutboundAuthenticationConfig localAndOutboundConfig = getLocalAndOutboundConfig(application);
        setIfNotNull(roleApiModel.getIncludeUserDomain(), localAndOutboundConfig::setUseUserstoreDomainInRoles);
    }
}
Also used : LocalAndOutboundAuthenticationConfig(org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig) ClaimConfig(org.wso2.carbon.identity.application.common.model.ClaimConfig) PermissionsAndRoleConfig(org.wso2.carbon.identity.application.common.model.PermissionsAndRoleConfig)

Aggregations

LocalAndOutboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig)27 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)13 LocalAndOutboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.xsd.LocalAndOutboundAuthenticationConfig)13 AuthenticationStep (org.wso2.carbon.identity.application.common.model.AuthenticationStep)8 Test (org.testng.annotations.Test)7 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 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 SequenceConfig (org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig)4 User (org.wso2.carbon.identity.application.common.model.User)4 AuthenticationScriptConfig (org.wso2.carbon.identity.application.common.model.script.AuthenticationScriptConfig)4 InboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig)4 InboundAuthenticationRequestConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig)4