|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.security.config.annotation.SecurityConfigurerAdapter<DefaultSecurityFilterChain,B>
org.springframework.security.config.annotation.web.configurers.X509Configurer<H>
public final class X509Configurer<H extends HttpSecurityBuilder<H>>
Adds X509 based pre authentication to an application. Since validating the
certificate happens when the client connects, the requesting and validation
of the client certificate should be performed by the container. Spring Security
will then use the certificate to look up the Authentication
for the user.
AuthenticationEntryPoint
is populated with an Http403ForbiddenEntryPoint
PreAuthenticatedAuthenticationProvider
is populated into
HttpSecurity.authenticationProvider(org.springframework.security.authentication.AuthenticationProvider)
UserDetailsService
shared object is used if no AuthenticationUserDetailsService
is specified
Constructor Summary | |
---|---|
X509Configurer()
Creates a new instance |
Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter |
---|
addObjectPostProcessor, and, getBuilder, postProcess, setBuilder |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public X509Configurer()
HttpSecurity.x509()
Method Detail |
---|
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 use
X509Configurer
for further customizationspublic X509Configurer<H> authenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails> authenticationDetailsSource)
AuthenticationDetailsSource
authenticationDetailsSource
- the AuthenticationDetailsSource
to use
X509Configurer
to usepublic X509Configurer<H> userDetailsService(UserDetailsService userDetailsService)
authenticationUserDetailsService(AuthenticationUserDetailsService)
with a UserDetailsByNameServiceWrapper
.
userDetailsService
- the UserDetailsService
to use
X509Configurer
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 use
X509Configurer
for further customizationspublic X509Configurer<H> subjectPrincipalRegex(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) throws Exception
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.
init
in interface SecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
init
in class SecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
Exception
public void configure(H http) throws Exception
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>>
Exception
public B disable()
AbstractHttpConfigurer
by removing it. After doing
so a fresh version of the configuration can be applied.
HttpSecurityBuilder
for additional customizationspublic T withObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |