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
ConstructorsConstructorDescriptionConstruct 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
Modifier and TypeMethodDescriptionvoidcommence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) protected StringdetermineUrlToUseForThisRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.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 Details
-
LoginEntryPoint
public LoginEntryPoint()Construct a redirect entry point with the default login form URL -
LoginEntryPoint
Construct a redirect entry point with the specified login form URL- Parameters:
loginFormUrl- the login form URL (required)
-
-
Method Details
-
commence
public void commence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) throws IOException, jakarta.servlet.ServletException - Specified by:
commencein interfaceorg.springframework.security.web.AuthenticationEntryPoint- Overrides:
commencein classorg.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint- Parameters:
request- the servlet requestresponse- the servlet responseauthException- the Authentication Exception- Throws:
IOException- if an IO error occursjakarta.servlet.ServletException- if a servlet error occurs- See Also:
-
determineUrlToUseForThisRequest
protected String determineUrlToUseForThisRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.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:
determineUrlToUseForThisRequestin 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())
-