Class RedirectServerAuthenticationFailureHandler
java.lang.Object
org.springframework.security.web.server.authentication.RedirectServerAuthenticationFailureHandler
- All Implemented Interfaces:
ServerAuthenticationFailureHandler
public class RedirectServerAuthenticationFailureHandler
extends Object
implements ServerAuthenticationFailureHandler
Performs a redirect to a specified location.
- Since:
- 5.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>onAuthenticationFailure(WebFilterExchange webFilterExchange, org.springframework.security.core.AuthenticationException exception) Invoked when authentication attempt failsvoidsetRedirectStrategy(ServerRedirectStrategy redirectStrategy) Sets the RedirectStrategy to use.
-
Constructor Details
-
RedirectServerAuthenticationFailureHandler
Creates an instance- Parameters:
location- the location to redirect to (i.e. "/login?failed")
-
-
Method Details
-
setRedirectStrategy
Sets the RedirectStrategy to use.- Parameters:
redirectStrategy- the strategy to use. Default is DefaultRedirectStrategy.
-
onAuthenticationFailure
public reactor.core.publisher.Mono<Void> onAuthenticationFailure(WebFilterExchange webFilterExchange, org.springframework.security.core.AuthenticationException exception) Description copied from interface:ServerAuthenticationFailureHandlerInvoked when authentication attempt fails- Specified by:
onAuthenticationFailurein interfaceServerAuthenticationFailureHandler- Parameters:
webFilterExchange- the exchangeexception- the reason authentication failed- Returns:
- a completion notification (success or error)
-