Search in sources :

Example 1 with AcceptAuthenticationProperties

use of org.apereo.cas.configuration.model.support.generic.AcceptAuthenticationProperties in project cas by apereo.

the class CasCoreAuthenticationHandlersConfiguration method acceptUsersAuthenticationHandler.

@RefreshScope
@Bean
public AuthenticationHandler acceptUsersAuthenticationHandler() {
    final AcceptAuthenticationProperties acceptAuthenticationProperties = casProperties.getAuthn().getAccept();
    final HashMap<String, String> users = new HashMap<>();
    final AcceptUsersAuthenticationHandler h = new AcceptUsersAuthenticationHandler(acceptAuthenticationProperties.getName(), servicesManager, acceptUsersPrincipalFactory(), null, users);
    h.setUsers(getParsedUsers());
    h.setPasswordEncoder(Beans.newPasswordEncoder(acceptAuthenticationProperties.getPasswordEncoder()));
    if (acceptPasswordPolicyConfiguration != null) {
        h.setPasswordPolicyConfiguration(acceptPasswordPolicyConfiguration);
    }
    h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(acceptAuthenticationProperties.getPrincipalTransformation()));
    return h;
}
Also used : HashMap(java.util.HashMap) AcceptUsersAuthenticationHandler(org.apereo.cas.authentication.AcceptUsersAuthenticationHandler) AcceptAuthenticationProperties(org.apereo.cas.configuration.model.support.generic.AcceptAuthenticationProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

HashMap (java.util.HashMap)1 AcceptUsersAuthenticationHandler (org.apereo.cas.authentication.AcceptUsersAuthenticationHandler)1 AcceptAuthenticationProperties (org.apereo.cas.configuration.model.support.generic.AcceptAuthenticationProperties)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1