Search in sources :

Example 1 with MongoDbAuthenticationHandler

use of org.apereo.cas.authentication.MongoDbAuthenticationHandler in project cas by apereo.

the class CasMongoAuthenticationConfiguration method mongoAuthenticationHandler.

@Bean
@RefreshScope
public AuthenticationHandler mongoAuthenticationHandler() {
    final MongoAuthenticationProperties mongo = casProperties.getAuthn().getMongo();
    final MongoDbAuthenticationHandler handler = new MongoDbAuthenticationHandler(mongo.getName(), servicesManager, mongoPrincipalFactory());
    handler.setAuthenticator(mongoAuthenticatorProfileService());
    handler.setPrincipalNameTransformer(PrincipalNameTransformerUtils.newPrincipalNameTransformer(mongo.getPrincipalTransformation()));
    return handler;
}
Also used : MongoAuthenticationProperties(org.apereo.cas.configuration.model.support.mongo.MongoAuthenticationProperties) MongoDbAuthenticationHandler(org.apereo.cas.authentication.MongoDbAuthenticationHandler) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

MongoDbAuthenticationHandler (org.apereo.cas.authentication.MongoDbAuthenticationHandler)1 MongoAuthenticationProperties (org.apereo.cas.configuration.model.support.mongo.MongoAuthenticationProperties)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