Class ServerHttpSecurity.HttpBasicSpec
java.lang.Object
org.springframework.security.config.web.server.ServerHttpSecurity.HttpBasicSpec
- Enclosing class:
- ServerHttpSecurity
Configures HTTP Basic Authentication
- Since:
- 5.0
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionand()Deprecated, for removal: This API element is subject to removal in a future version.For removal in 7.0.authenticationEntryPoint(ServerAuthenticationEntryPoint authenticationEntryPoint) Allows easily setting the entry point.authenticationFailureHandler(ServerAuthenticationFailureHandler authenticationFailureHandler) authenticationManager(ReactiveAuthenticationManager authenticationManager) TheReactiveAuthenticationManagerused to authenticate.authenticationSuccessHandler(Consumer<List<ServerAuthenticationSuccessHandler>> handlersConsumer) Allows customizing the list ofServerAuthenticationSuccessHandler.authenticationSuccessHandler(ServerAuthenticationSuccessHandler authenticationSuccessHandler) TheServerAuthenticationSuccessHandlerused after authentication success.protected voidconfigure(ServerHttpSecurity http) disable()Disables HTTP Basic authentication.securityContextRepository(ServerSecurityContextRepository securityContextRepository) TheServerSecurityContextRepositoryused to save theAuthentication.
- 
Method Details- 
authenticationSuccessHandlerpublic ServerHttpSecurity.HttpBasicSpec authenticationSuccessHandler(ServerAuthenticationSuccessHandler authenticationSuccessHandler) TheServerAuthenticationSuccessHandlerused after authentication success. Defaults toWebFilterChainServerAuthenticationSuccessHandler. Note that this method clears previously added success handlers viaauthenticationSuccessHandler(Consumer)- Parameters:
- authenticationSuccessHandler- the success handler to use
- Returns:
- the ServerHttpSecurity.HttpBasicSpecto continue configuring
- Since:
- 6.3
 
- 
authenticationSuccessHandlerpublic ServerHttpSecurity.HttpBasicSpec authenticationSuccessHandler(Consumer<List<ServerAuthenticationSuccessHandler>> handlersConsumer) Allows customizing the list ofServerAuthenticationSuccessHandler. The default list contains aWebFilterChainServerAuthenticationSuccessHandler.- Parameters:
- handlersConsumer- the handlers consumer
- Returns:
- the ServerHttpSecurity.HttpBasicSpecto continue configuring
- Since:
- 6.3
 
- 
authenticationManagerpublic ServerHttpSecurity.HttpBasicSpec authenticationManager(ReactiveAuthenticationManager authenticationManager) TheReactiveAuthenticationManagerused to authenticate. Defaults toServerHttpSecurity.authenticationManager(ReactiveAuthenticationManager).- Parameters:
- authenticationManager- the authentication manager to use
- Returns:
- the ServerHttpSecurity.HttpBasicSpecto continue configuring
 
- 
securityContextRepositorypublic ServerHttpSecurity.HttpBasicSpec securityContextRepository(ServerSecurityContextRepository securityContextRepository) TheServerSecurityContextRepositoryused to save theAuthentication. Defaults toNoOpServerSecurityContextRepository. For theSecurityContextto be loaded on subsequent requests theReactorContextWebFiltermust be configured to be able to load the value (they are not implicitly linked).- Parameters:
- securityContextRepository- the repository to use
- Returns:
- the ServerHttpSecurity.HttpBasicSpecto continue configuring
 
- 
authenticationEntryPointpublic ServerHttpSecurity.HttpBasicSpec authenticationEntryPoint(ServerAuthenticationEntryPoint authenticationEntryPoint) Allows easily setting the entry point.- Parameters:
- authenticationEntryPoint- the- ServerAuthenticationEntryPointto use
- Returns:
- ServerHttpSecurity.HttpBasicSpecfor additional customization
- Since:
- 5.2.0
 
- 
authenticationFailureHandlerpublic ServerHttpSecurity.HttpBasicSpec authenticationFailureHandler(ServerAuthenticationFailureHandler authenticationFailureHandler) 
- 
andDeprecated, for removal: This API element is subject to removal in a future version.For removal in 7.0. UseServerHttpSecurity.httpBasic(Customizer)orhttpBasic(Customizer.withDefaults())to stick with defaults. See the documentation for more details.Allows method chaining to continue configuring theServerHttpSecurity- Returns:
- the ServerHttpSecurityto continue configuring
 
- 
disableDisables HTTP Basic authentication.- Returns:
- the ServerHttpSecurityto continue configuring
 
- 
configure
 
-