Search in sources :

Example 1 with JsonResourceAuthenticationProperties

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

the class JsonResourceAuthenticationEventExecutionPlanConfiguration method jsonResourceAuthenticationHandler.

@RefreshScope
@Bean
public AuthenticationHandler jsonResourceAuthenticationHandler() {
    final JsonResourceAuthenticationProperties jsonProps = casProperties.getAuthn().getJson();
    final JsonResourceAuthenticationHandler h = new JsonResourceAuthenticationHandler(jsonProps.getName(), servicesManager, jsonPrincipalFactory(), null, jsonProps.getLocation());
    h.setPasswordEncoder(PasswordEncoderUtils.newPasswordEncoder(jsonProps.getPasswordEncoder()));
    if (jsonProps.getPasswordPolicy().isEnabled()) {
        h.setPasswordPolicyConfiguration(new PasswordPolicyConfiguration(jsonProps.getPasswordPolicy()));
    }
    h.setPrincipalNameTransformer(PrincipalNameTransformerUtils.newPrincipalNameTransformer(jsonProps.getPrincipalTransformation()));
    return h;
}
Also used : JsonResourceAuthenticationHandler(org.apereo.cas.adaptors.generic.JsonResourceAuthenticationHandler) PasswordPolicyConfiguration(org.apereo.cas.authentication.support.password.PasswordPolicyConfiguration) JsonResourceAuthenticationProperties(org.apereo.cas.configuration.model.support.generic.JsonResourceAuthenticationProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

JsonResourceAuthenticationHandler (org.apereo.cas.adaptors.generic.JsonResourceAuthenticationHandler)1 PasswordPolicyConfiguration (org.apereo.cas.authentication.support.password.PasswordPolicyConfiguration)1 JsonResourceAuthenticationProperties (org.apereo.cas.configuration.model.support.generic.JsonResourceAuthenticationProperties)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