Search in sources :

Example 1 with X509SubjectAlternativeNameUPNPrincipalResolver

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

the class X509AuthenticationConfiguration method x509SubjectAlternativeNameUPNPrincipalResolver.

@Bean
@RefreshScope
public PrincipalResolver x509SubjectAlternativeNameUPNPrincipalResolver() {
    final X509Properties x509 = casProperties.getAuthn().getX509();
    final X509SubjectAlternativeNameUPNPrincipalResolver r = new X509SubjectAlternativeNameUPNPrincipalResolver();
    r.setAttributeRepository(attributeRepository);
    r.setPrincipalAttributeName(x509.getPrincipal().getPrincipalAttribute());
    r.setReturnNullIfNoAttributes(x509.getPrincipal().isReturnNull());
    r.setPrincipalFactory(x509PrincipalFactory());
    return r;
}
Also used : X509SubjectAlternativeNameUPNPrincipalResolver(org.apereo.cas.adaptors.x509.authentication.principal.X509SubjectAlternativeNameUPNPrincipalResolver) 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

X509SubjectAlternativeNameUPNPrincipalResolver (org.apereo.cas.adaptors.x509.authentication.principal.X509SubjectAlternativeNameUPNPrincipalResolver)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