public final class X509Configurer<H extends HttpSecurityBuilder<H>> extends AbstractHttpConfigurer<X509Configurer<H>,H>
Authentication
for the user.
The following Filters are populated
The following shared objects are created
AuthenticationEntryPoint
is populated with an
Http403ForbiddenEntryPoint
PreAuthenticatedAuthenticationProvider
is populated into
HttpSecurity.authenticationProvider(org.springframework.security.authentication.AuthenticationProvider)
The following shared objects are used:
UserDetailsService
shared object is used if no
AuthenticationUserDetailsService
is specifiedConstructor and Description |
---|
X509Configurer()
Creates a new instance
|
disable, withObjectPostProcessor
addObjectPostProcessor, and, getBuilder, postProcess, setBuilder
public X509Configurer()
HttpSecurity.x509()
public X509Configurer<H> x509AuthenticationFilter(X509AuthenticationFilter x509AuthenticationFilter)
X509AuthenticationFilter
. If this is
specified, the properties on X509Configurer
will not be populated on the
X509AuthenticationFilter
.x509AuthenticationFilter
- the X509AuthenticationFilter
to useX509Configurer
for further customizationspublic X509Configurer<H> x509PrincipalExtractor(X509PrincipalExtractor x509PrincipalExtractor)
X509PrincipalExtractor
x509PrincipalExtractor
- the X509PrincipalExtractor
to useX509Configurer
to usepublic X509Configurer<H> authenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails> authenticationDetailsSource)
AuthenticationDetailsSource
authenticationDetailsSource
- the AuthenticationDetailsSource
to useX509Configurer
to usepublic X509Configurer<H> userDetailsService(UserDetailsService userDetailsService)
authenticationUserDetailsService(AuthenticationUserDetailsService)
with a
UserDetailsByNameServiceWrapper
.userDetailsService
- the UserDetailsService
to useX509Configurer
for further customizationspublic X509Configurer<H> authenticationUserDetailsService(AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> authenticationUserDetailsService)
AuthenticationUserDetailsService
to use. If not specified,
the shared UserDetailsService
will be used to create a
UserDetailsByNameServiceWrapper
.authenticationUserDetailsService
- the AuthenticationUserDetailsService
to useX509Configurer
for further customizationspublic X509Configurer<H> subjectPrincipalRegex(java.lang.String subjectPrincipalRegex)
SubjectDnX509PrincipalExtractor
is
used.subjectPrincipalRegex
- the regex to extract the user principal from the
certificate (i.e. "CN=(.*?)(?:,|$)").X509Configurer
for further customizationspublic void init(H http)
SecurityConfigurer
SecurityBuilder
. Here only shared state should be created
and modified, but not properties on the SecurityBuilder
used for building
the object. This ensures that the SecurityConfigurer.configure(SecurityBuilder)
method uses
the correct shared objects when building. Configurers should be applied here.init
in interface SecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
init
in class SecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
public void configure(H http)
SecurityConfigurer
SecurityBuilder
by setting the necessary properties on the
SecurityBuilder
.configure
in interface SecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
configure
in class SecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>