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;
}
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;
}
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);
}
}
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);
}
}
Aggregations