Class RedirectLoginFailureHandler<A extends ExchangeContext,B extends Exchange<A>>

java.lang.Object
io.inverno.mod.security.http.form.RedirectLoginFailureHandler<A,B>
Type Parameters:
A - the context type
B - the exchange type
All Implemented Interfaces:
LoginFailureHandler<A,B>

public class RedirectLoginFailureHandler<A extends ExchangeContext,B extends Exchange<A>> extends Object implements LoginFailureHandler<A,B>

A login failure handler implementation that redirects the client (302) after a failed login authentication.

Since:
1.5
Author:
Jeremy Kuhn
See Also:
  • Field Details

    • DEFAULT_LOGIN_FAILURE_URI

      public static final String DEFAULT_LOGIN_FAILURE_URI
      The default login failure URI: /login.
      See Also:
  • Constructor Details

    • RedirectLoginFailureHandler

      public RedirectLoginFailureHandler()

      Creates a redirect login failure handler which redirects the client to the default login failure URI.

    • RedirectLoginFailureHandler

      public RedirectLoginFailureHandler(String loginFailureUri)

      Creates a redirect login failure handler which redirects the client to the specified login failure URI.

      Parameters:
      loginFailureUri - the URI where to redirect the client after a failed login authentication
  • Method Details

    • getLoginFailureUri

      public String getLoginFailureUri()

      Returns the URI where the client is redirected after a failed login authentication.

      Returns:
      the login failure URI
    • handleLoginFailure

      public Mono<Void> handleLoginFailure(B exchange, SecurityException error)
      Description copied from interface: LoginFailureHandler

      Handles failed authentication.

      Specified by:
      handleLoginFailure in interface LoginFailureHandler<A extends ExchangeContext,B extends Exchange<A>>
      Parameters:
      exchange - the exchange
      error - the security error
      Returns:
      a mono which completes when the failure has been handled