public final class HttpBasicConfigurer<B extends HttpSecurityBuilder<B>> extends SecurityConfigurerAdapter<DefaultSecurityFilterChain,B>
authenticationEntryPoint(AuthenticationEntryPoint)
(default
BasicAuthenticationEntryPoint
)Constructor and Description |
---|
HttpBasicConfigurer()
Creates a new instance
|
Modifier and Type | Method and Description |
---|---|
HttpBasicConfigurer<B> |
authenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
Specifies a custom
AuthenticationDetailsSource to use for basic
authentication. |
HttpBasicConfigurer<B> |
authenticationEntryPoint(AuthenticationEntryPoint authenticationEntryPoint)
The
AuthenticationEntryPoint to be populated on
BasicAuthenticationFilter in the event that authentication fails. |
void |
configure(B http)
Configure the
SecurityBuilder by setting the necessary properties
on the SecurityBuilder . |
B |
disable()
Disables the
AbstractHttpConfigurer by removing it. |
void |
init(B http)
Initialize the
SecurityBuilder . |
HttpBasicConfigurer<B> |
realmName(String realmName)
Allows easily changing the realm, but leaving the remaining defaults in
place.
|
T |
withObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor) |
addObjectPostProcessor, and, getBuilder, postProcess, setBuilder
public HttpBasicConfigurer<B> realmName(String realmName) throws Exception
authenticationEntryPoint(AuthenticationEntryPoint)
has
been invoked, invoking this method will result in an error.realmName
- the HTTP Basic realm to useHttpBasicConfigurer
for additional customizationException
public HttpBasicConfigurer<B> authenticationEntryPoint(AuthenticationEntryPoint authenticationEntryPoint)
AuthenticationEntryPoint
to be populated on
BasicAuthenticationFilter
in the event that authentication fails.
The default to use BasicAuthenticationEntryPoint
with the realm
"Spring Security Application".authenticationEntryPoint
- the AuthenticationEntryPoint
to useHttpBasicConfigurer
for additional customizationpublic HttpBasicConfigurer<B> authenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
AuthenticationDetailsSource
to use for basic
authentication. The default is WebAuthenticationDetailsSource
.authenticationDetailsSource
- the custom AuthenticationDetailsSource
to useHttpBasicConfigurer
for additional customizationpublic void init(B 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,B extends HttpSecurityBuilder<B>>
init
in class SecurityConfigurerAdapter<DefaultSecurityFilterChain,B extends HttpSecurityBuilder<B>>
Exception
public void configure(B http) throws Exception
SecurityConfigurer
SecurityBuilder
by setting the necessary properties
on the SecurityBuilder
.configure
in interface SecurityConfigurer<DefaultSecurityFilterChain,B extends HttpSecurityBuilder<B>>
configure
in class SecurityConfigurerAdapter<DefaultSecurityFilterChain,B extends HttpSecurityBuilder<B>>
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)