Class OttAuthenticationFailureHandler

java.lang.Object
com.irurueta.authserver.authorization.api.web.ott.OttAuthenticationFailureHandler
All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationFailureHandler

public class OttAuthenticationFailureHandler extends Object implements org.springframework.security.web.authentication.AuthenticationFailureHandler
Sends the browser back after a failed submission to POST /login/ott: a wrong numeric code goes to the page where it is typed (/login/ott?error), so the user can try again, and a magic link that is not valid goes to the sign-in page (/login?error). Both keep the failure in the session, as Spring Security does, for the page to show a message that never says whether the account exists or the code was close.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.springframework.security.web.authentication.AuthenticationFailureHandler
    Handler of a failed code.
    private final org.springframework.security.web.authentication.AuthenticationFailureHandler
    Handler of a failed link.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception)
    Redirects according to what was submitted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • codeFailure

      private final org.springframework.security.web.authentication.AuthenticationFailureHandler codeFailure
      Handler of a failed code.
    • linkFailure

      private final org.springframework.security.web.authentication.AuthenticationFailureHandler linkFailure
      Handler of a failed link.
  • Constructor Details

    • OttAuthenticationFailureHandler

      public OttAuthenticationFailureHandler()
  • Method Details

    • onAuthenticationFailure

      public void onAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception) throws IOException, jakarta.servlet.ServletException
      Redirects according to what was submitted.
      Specified by:
      onAuthenticationFailure in interface org.springframework.security.web.authentication.AuthenticationFailureHandler
      Parameters:
      request - the request.
      response - the response.
      exception - the failure.
      Throws:
      IOException - if the redirect cannot be sent.
      jakarta.servlet.ServletException - if the delegate fails.