Class RecoveryCodesSuccessHandler
java.lang.Object
com.irurueta.authserver.authorization.api.web.totp.RecoveryCodesSuccessHandler
- All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler
public class RecoveryCodesSuccessHandler
extends Object
implements org.springframework.security.web.authentication.AuthenticationSuccessHandler
Success handler of the second-factor post: when the post confirmed an enrolment and recovery codes are waiting to be
shown, the browser goes to the page that shows them once (whose "Continue" button resumes the interrupted request);
otherwise the delegate resumes the interrupted request straight away.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.security.web.authentication.AuthenticationSuccessHandlerHandler that resumes the interrupted request.private final PendingRecoveryCodesKeeps the codes waiting to be shown.private final org.springframework.security.web.RedirectStrategyStrategy that redirects, honouring the context path. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) Redirects to the recovery codes page or resumes the interrupted request.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
onAuthenticationSuccess
-
Field Details
-
redirectStrategy
private final org.springframework.security.web.RedirectStrategy redirectStrategyStrategy that redirects, honouring the context path. -
pendingRecoveryCodes
Keeps the codes waiting to be shown. -
delegate
private final org.springframework.security.web.authentication.AuthenticationSuccessHandler delegateHandler that resumes the interrupted request.
-
-
Constructor Details
-
RecoveryCodesSuccessHandler
public RecoveryCodesSuccessHandler()
-
-
Method Details
-
onAuthenticationSuccess
public void onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws IOException, jakarta.servlet.ServletException Redirects to the recovery codes page or resumes the interrupted request.- Specified by:
onAuthenticationSuccessin interfaceorg.springframework.security.web.authentication.AuthenticationSuccessHandler- Parameters:
request- the request.response- the response.authentication- the verified authentication.- Throws:
IOException- if the redirect cannot be sent.jakarta.servlet.ServletException- if the delegate fails.
-