Search in sources :

Example 1 with SpnegoPrincipalResolver

use of org.apereo.cas.support.spnego.authentication.principal.SpnegoPrincipalResolver in project cas by apereo.

the class SpnegoConfiguration method spnegoPrincipalResolver.

@Bean
@RefreshScope
public PrincipalResolver spnegoPrincipalResolver() {
    final SpnegoProperties spnegoProperties = casProperties.getAuthn().getSpnego();
    final SpnegoPrincipalResolver r = new SpnegoPrincipalResolver();
    r.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(spnegoProperties.getPrincipalTransformation()));
    r.setAttributeRepository(attributeRepository);
    r.setPrincipalAttributeName(spnegoProperties.getPrincipal().getPrincipalAttribute());
    r.setReturnNullIfNoAttributes(spnegoProperties.getPrincipal().isReturnNull());
    r.setPrincipalFactory(spnegoPrincipalFactory());
    return r;
}
Also used : SpnegoPrincipalResolver(org.apereo.cas.support.spnego.authentication.principal.SpnegoPrincipalResolver) SpnegoProperties(org.apereo.cas.configuration.model.support.spnego.SpnegoProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

SpnegoProperties (org.apereo.cas.configuration.model.support.spnego.SpnegoProperties)1 SpnegoPrincipalResolver (org.apereo.cas.support.spnego.authentication.principal.SpnegoPrincipalResolver)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