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
FieldsModifier and TypeFieldDescription(package private) static final StringQuery of the identities page after a refused link.private final org.springframework.security.web.authentication.AuthenticationFailureHandlerThe handler of every other failure. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception) Handles a failed sign-in or link.
-
Field Details
-
ALREADY_LINKED_STATUS
Query of the identities page after a refused link.- See Also:
-
delegate
private final org.springframework.security.web.authentication.AuthenticationFailureHandler delegateThe 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:
onAuthenticationFailurein interfaceorg.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.
-