Search in sources :

Example 1 with JaasAuthenticationProperties

use of org.apereo.cas.configuration.model.support.jaas.JaasAuthenticationProperties in project cas by apereo.

the class CasCoreAuthenticationHandlersConfiguration method jaasAuthenticationHandler.

@RefreshScope
@Bean
public AuthenticationHandler jaasAuthenticationHandler() {
    final JaasAuthenticationProperties jaas = casProperties.getAuthn().getJaas();
    final JaasAuthenticationHandler h = new JaasAuthenticationHandler(jaas.getName(), servicesManager, jaasPrincipalFactory(), null);
    h.setKerberosKdcSystemProperty(jaas.getKerberosKdcSystemProperty());
    h.setKerberosRealmSystemProperty(jaas.getKerberosRealmSystemProperty());
    h.setRealm(jaas.getRealm());
    h.setPasswordEncoder(Beans.newPasswordEncoder(jaas.getPasswordEncoder()));
    if (jaasPasswordPolicyConfiguration != null) {
        h.setPasswordPolicyConfiguration(jaasPasswordPolicyConfiguration);
    }
    h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(jaas.getPrincipalTransformation()));
    return h;
}
Also used : JaasAuthenticationProperties(org.apereo.cas.configuration.model.support.jaas.JaasAuthenticationProperties) JaasAuthenticationHandler(org.apereo.cas.authentication.handler.support.JaasAuthenticationHandler) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

JaasAuthenticationHandler (org.apereo.cas.authentication.handler.support.JaasAuthenticationHandler)1 JaasAuthenticationProperties (org.apereo.cas.configuration.model.support.jaas.JaasAuthenticationProperties)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