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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Path of the login page.
    private final org.springframework.security.web.RedirectStrategy
    Strategy that redirects, honouring the context path.
    private final org.springframework.security.web.savedrequest.RequestCache
    Cache that keeps the request to resume after signing in, shared with the form login.
    private final org.springframework.security.web.context.SecurityContextRepository
    Repository that stores the security context of the session.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    commence(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.

    Methods inherited from class java.lang.Object

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

    • LOGIN_PATH

      public static final String LOGIN_PATH
      Path of the login page.
      See Also:
    • redirectStrategy

      private final org.springframework.security.web.RedirectStrategy redirectStrategy
      Strategy that redirects, honouring the context path.
    • requestCache

      private final org.springframework.security.web.savedrequest.RequestCache requestCache
      Cache that keeps the request to resume after signing in, shared with the form login.
    • securityContextRepository

      private final org.springframework.security.web.context.SecurityContextRepository securityContextRepository
      Repository 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:
      commence in interface org.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.