public final class HttpBasicConfigurer<B extends HttpSecurityBuilder<B>> extends AbstractHttpConfigurer<HttpBasicConfigurer<B>,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 . |
void |
init(B http)
Initialize the
SecurityBuilder . |
HttpBasicConfigurer<B> |
realmName(java.lang.String realmName)
Allows easily changing the realm, but leaving the remaining defaults in place.
|
disable, withObjectPostProcessor
addObjectPostProcessor, and, getBuilder, postProcess, setBuilder
public HttpBasicConfigurer()
HttpSecurity.httpBasic()
public HttpBasicConfigurer<B> realmName(java.lang.String realmName)
authenticationEntryPoint(AuthenticationEntryPoint)
has been invoked,
invoking this method will result in an error.realmName
- the HTTP Basic realm to useHttpBasicConfigurer
for additional customizationpublic 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
"Realm".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)
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,B extends HttpSecurityBuilder<B>>
init
in class SecurityConfigurerAdapter<DefaultSecurityFilterChain,B extends HttpSecurityBuilder<B>>
public void configure(B http)
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>>