use of org.wso2.carbon.identity.application.mgt.defaultsequence.DefaultAuthSeqMgtService in project carbon-identity-framework by wso2.
the class ApplicationManagementServiceImpl method setDefaultAuthenticationSeq.
private void setDefaultAuthenticationSeq(String sequenceName, String tenantDomain, ServiceProvider serviceProvider) throws IdentityApplicationManagementException {
// if "Authentication Type" is "Default", get the tenant wise default authentication sequence if
// available, otherwise the authentication sequence and adaptive script configuration in default SP
DefaultAuthSeqMgtService seqMgtService = DefaultAuthSeqMgtServiceImpl.getInstance();
DefaultAuthenticationSequence sequence;
try {
sequence = seqMgtService.getDefaultAuthenticationSeq(sequenceName, tenantDomain);
} catch (DefaultAuthSeqMgtException e) {
throw new IdentityApplicationManagementException("Error when retrieving default " + "authentication sequence in tenant: " + tenantDomain, e);
}
if (sequence != null && sequence.getContent() != null) {
serviceProvider.getLocalAndOutBoundAuthenticationConfig().setAuthenticationSteps(sequence.getContent().getAuthenticationSteps());
serviceProvider.getLocalAndOutBoundAuthenticationConfig().setAuthenticationScriptConfig(sequence.getContent().getAuthenticationScriptConfig());
} else {
ServiceProvider defaultSP = ApplicationManagementServiceComponent.getFileBasedSPs().get(IdentityApplicationConstants.DEFAULT_SP_CONFIG);
serviceProvider.getLocalAndOutBoundAuthenticationConfig().setAuthenticationSteps(defaultSP.getLocalAndOutBoundAuthenticationConfig().getAuthenticationSteps());
serviceProvider.getLocalAndOutBoundAuthenticationConfig().setAuthenticationScriptConfig(defaultSP.getLocalAndOutBoundAuthenticationConfig().getAuthenticationScriptConfig());
}
}
Aggregations