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 Details

    • RedirectServerAuthenticationFailureHandler

      public RedirectServerAuthenticationFailureHandler(String location)
      Creates an instance
      Parameters:
      location - the location to redirect to (i.e. "/login?failed")
  • Method Details

    • setRedirectStrategy

      public void setRedirectStrategy(ServerRedirectStrategy redirectStrategy)
      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: ServerAuthenticationFailureHandler
      Invoked when authentication attempt fails
      Specified by:
      onAuthenticationFailure in interface ServerAuthenticationFailureHandler
      Parameters:
      webFilterExchange - the exchange
      exception - the reason authentication failed
      Returns:
      a completion notification (success or error)