Package com.avoka.fc.core.security
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 LoginEntryPoint()
Construct a redirect entry point with the default login form URLLoginEntryPoint(String loginFormUrl)
Construct a redirect entry point with the specified login form URL
-
Method Summary
All Methods Instance Methods Concrete Methods 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
-
-
-
-
Constructor Detail
-
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 Detail
-
commence
public void commence(HttpServletRequest request, HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) throws IOException, ServletException
- Specified by:
commence
in interfaceorg.springframework.security.web.AuthenticationEntryPoint
- Overrides:
commence
in classorg.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint
- Parameters:
request
- the servlet requestresponse
- the servlet responseauthException
- the Authentication Exception- Throws:
IOException
- if an IO error occursServletException
- 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 classorg.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint
- Parameters:
request
- the requestresponse
- the responseexception
- the exception- Returns:
- the URL (cannot be null or empty; defaults to
LoginUrlAuthenticationEntryPoint.getLoginFormUrl()
)
-
-