Search in sources :

Example 41 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.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 42 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.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 43 with LocalAndOutboundAuthenticationConfig

use of org.wso2.carbon.identity.application.common.model.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 44 with LocalAndOutboundAuthenticationConfig

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