Search in sources :

Example 1 with X509SubjectPrincipalResolver

use of org.apereo.cas.adaptors.x509.authentication.principal.X509SubjectPrincipalResolver in project cas by apereo.

the class X509AuthenticationConfiguration method x509SubjectPrincipalResolver.

@Bean
@RefreshScope
public PrincipalResolver x509SubjectPrincipalResolver() {
    final X509Properties x509 = casProperties.getAuthn().getX509();
    final X509SubjectPrincipalResolver r = new X509SubjectPrincipalResolver(x509.getPrincipalDescriptor());
    r.setAttributeRepository(attributeRepository);
    r.setPrincipalAttributeName(x509.getPrincipal().getPrincipalAttribute());
    r.setReturnNullIfNoAttributes(x509.getPrincipal().isReturnNull());
    r.setPrincipalFactory(x509PrincipalFactory());
    return r;
}
Also used : X509SubjectPrincipalResolver(org.apereo.cas.adaptors.x509.authentication.principal.X509SubjectPrincipalResolver) X509Properties(org.apereo.cas.configuration.model.support.x509.X509Properties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

X509SubjectPrincipalResolver (org.apereo.cas.adaptors.x509.authentication.principal.X509SubjectPrincipalResolver)1 X509Properties (org.apereo.cas.configuration.model.support.x509.X509Properties)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