Class ReauthenticationEntryPoint
java.lang.Object
com.irurueta.authserver.authorization.api.web.mfa.ReauthenticationEntryPoint
- All Implemented Interfaces:
org.springframework.security.web.AuthenticationEntryPoint
public class ReauthenticationEntryPoint
extends Object
implements org.springframework.security.web.AuthenticationEntryPoint
Forces a new sign-in: it discards the stale authentication of the session (the security context of the thread and
the one stored by the repository), saves the request being served (typically
/oauth2/authorize?...) so it
resumes once the user has signed in again, and redirects to the login page.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPath of the login page.private final org.springframework.security.web.RedirectStrategyStrategy that redirects, honouring the context path.private final org.springframework.security.web.savedrequest.RequestCacheCache that keeps the request to resume after signing in, shared with the form login.private final org.springframework.security.web.context.SecurityContextRepositoryRepository that stores the security context of the session. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcommence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) Clears the authentication, saves the request and redirects to the login page.
-
Field Details
-
LOGIN_PATH
Path of the login page.- See Also:
-
redirectStrategy
private final org.springframework.security.web.RedirectStrategy redirectStrategyStrategy that redirects, honouring the context path. -
requestCache
private final org.springframework.security.web.savedrequest.RequestCache requestCacheCache that keeps the request to resume after signing in, shared with the form login. -
securityContextRepository
private final org.springframework.security.web.context.SecurityContextRepository securityContextRepositoryRepository that stores the security context of the session.
-
-
Constructor Details
-
ReauthenticationEntryPoint
public ReauthenticationEntryPoint()
-
-
Method Details
-
commence
public void commence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) throws IOException Clears the authentication, saves the request and redirects to the login page.- Specified by:
commencein interfaceorg.springframework.security.web.AuthenticationEntryPoint- Parameters:
request- the request that needs a new sign-in.response- the response to redirect.authException- why the request was refused.- Throws:
IOException- if the redirect cannot be sent.
-