Search in sources :

Example 1 with X509AuthenticationFilter

use of org.springframework.security.web.authentication.preauth.x509.X509AuthenticationFilter in project spring-security by spring-projects.

the class X509Configurer method getFilter.

private X509AuthenticationFilter getFilter(AuthenticationManager authenticationManager) {
    if (x509AuthenticationFilter == null) {
        x509AuthenticationFilter = new X509AuthenticationFilter();
        x509AuthenticationFilter.setAuthenticationManager(authenticationManager);
        if (subjectPrincipalRegex != null) {
            SubjectDnX509PrincipalExtractor principalExtractor = new SubjectDnX509PrincipalExtractor();
            principalExtractor.setSubjectDnRegex(subjectPrincipalRegex);
            x509AuthenticationFilter.setPrincipalExtractor(principalExtractor);
        }
        if (authenticationDetailsSource != null) {
            x509AuthenticationFilter.setAuthenticationDetailsSource(authenticationDetailsSource);
        }
        x509AuthenticationFilter = postProcess(x509AuthenticationFilter);
    }
    return x509AuthenticationFilter;
}
Also used : X509AuthenticationFilter(org.springframework.security.web.authentication.preauth.x509.X509AuthenticationFilter) SubjectDnX509PrincipalExtractor(org.springframework.security.web.authentication.preauth.x509.SubjectDnX509PrincipalExtractor)

Example 2 with X509AuthenticationFilter

use of org.springframework.security.web.authentication.preauth.x509.X509AuthenticationFilter in project spring-security by spring-projects.

the class X509Configurer method configure.

// @formatter:on
@Override
public void configure(H http) throws Exception {
    X509AuthenticationFilter filter = getFilter(http.getSharedObject(AuthenticationManager.class));
    http.addFilter(filter);
}
Also used : AuthenticationManager(org.springframework.security.authentication.AuthenticationManager) X509AuthenticationFilter(org.springframework.security.web.authentication.preauth.x509.X509AuthenticationFilter)

Aggregations

X509AuthenticationFilter (org.springframework.security.web.authentication.preauth.x509.X509AuthenticationFilter)2 AuthenticationManager (org.springframework.security.authentication.AuthenticationManager)1 SubjectDnX509PrincipalExtractor (org.springframework.security.web.authentication.preauth.x509.SubjectDnX509PrincipalExtractor)1