Class LoginEntryPoint

java.lang.Object
org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint
com.avoka.fc.core.security.LoginEntryPoint
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.security.web.AuthenticationEntryPoint

public class LoginEntryPoint extends org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint
Extends Spring security to handle session timeout requests differently for AJAX. 1. return non redirecting HTTP status code: 403 2. Remove the initial request URL
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a redirect entry point with the default login form URL
    LoginEntryPoint(String loginFormUrl)
    Construct a redirect entry point with the specified login form URL
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    commence(HttpServletRequest request, HttpServletResponse response, org.springframework.security.core.AuthenticationException authException)
     
    protected String
    determineUrlToUseForThisRequest(HttpServletRequest request, HttpServletResponse response, org.springframework.security.core.AuthenticationException exception)
    Allows subclasses to modify the login form URL that should be applicable for a given request.

    Methods inherited from class org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint

    afterPropertiesSet, buildHttpsRedirectUrlForRequest, buildRedirectUrlToLoginPage, getLoginFormUrl, getPortMapper, getPortResolver, isForceHttps, isUseForward, setForceHttps, setPortMapper, setPortResolver, setUseForward

    Methods inherited from class java.lang.Object

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

    • LoginEntryPoint

      public LoginEntryPoint()
      Construct a redirect entry point with the default login form URL
    • LoginEntryPoint

      public LoginEntryPoint(String loginFormUrl)
      Construct a redirect entry point with the specified login form URL
      Parameters:
      loginFormUrl - the login form URL (required)
  • Method Details

    • commence

      public void commence(HttpServletRequest request, HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) throws IOException, ServletException
      Specified by:
      commence in interface org.springframework.security.web.AuthenticationEntryPoint
      Overrides:
      commence in class org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint
      Parameters:
      request - the servlet request
      response - the servlet response
      authException - the Authentication Exception
      Throws:
      IOException - if an IO error occurs
      ServletException - if a servlet error occurs
      See Also:
      • AuthenticationEntryPoint.commence(HttpServletRequest, HttpServletResponse, AuthenticationException)
    • determineUrlToUseForThisRequest

      protected String determineUrlToUseForThisRequest(HttpServletRequest request, HttpServletResponse response, org.springframework.security.core.AuthenticationException exception)
      Allows subclasses to modify the login form URL that should be applicable for a given request.
      Overrides:
      determineUrlToUseForThisRequest in class org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint
      Parameters:
      request - the request
      response - the response
      exception - the exception
      Returns:
      the URL (cannot be null or empty; defaults to LoginUrlAuthenticationEntryPoint.getLoginFormUrl())