Search in sources :

Example 1 with X509SerialNumberPrincipalResolver

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

the class X509AuthenticationConfiguration method x509SerialNumberPrincipalResolver.

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

Aggregations

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