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
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.security.web.authentication.AuthenticationFailureHandlerHandler of a failed code.private final org.springframework.security.web.authentication.AuthenticationFailureHandlerHandler of a failed link. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception) Redirects according to what was submitted.
-
Field Details
-
codeFailure
private final org.springframework.security.web.authentication.AuthenticationFailureHandler codeFailureHandler of a failed code. -
linkFailure
private final org.springframework.security.web.authentication.AuthenticationFailureHandler linkFailureHandler 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:
onAuthenticationFailurein interfaceorg.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.
-