Class FederatedAuthenticationFailureHandler

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

public class FederatedAuthenticationFailureHandler extends Object implements org.springframework.security.web.authentication.AuthenticationFailureHandler
Failure handler of the sign-in with an external provider. A refused link (FederatedAccountResolver.LINK_REFUSED: the identity belongs to another account) goes back to the identities page with the status already-linked; the session is still signed in as before, because a failed sign-in never saves a security context. Any other failure is handled by the delegate, the generic failure of the login page.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final String
    Query of the identities page after a refused link.
    private final org.springframework.security.web.authentication.AuthenticationFailureHandler
    The handler of every other failure.
  • 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)
    Handles a failed sign-in or link.

    Methods inherited from class java.lang.Object

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

    • ALREADY_LINKED_STATUS

      static final String ALREADY_LINKED_STATUS
      Query of the identities page after a refused link.
      See Also:
    • delegate

      private final org.springframework.security.web.authentication.AuthenticationFailureHandler delegate
      The handler of every other failure.
  • Constructor Details

    • FederatedAuthenticationFailureHandler

      public FederatedAuthenticationFailureHandler()
  • 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
      Handles a failed sign-in or link.
      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 fails.
      jakarta.servlet.ServletException - if the delegate fails.