Class SpringSessionRememberMeServices
java.lang.Object
org.springframework.session.security.web.authentication.SpringSessionRememberMeServices
- All Implemented Interfaces:
org.springframework.security.web.authentication.logout.LogoutHandler,org.springframework.security.web.authentication.RememberMeServices
public class SpringSessionRememberMeServices
extends Object
implements org.springframework.security.web.authentication.RememberMeServices, org.springframework.security.web.authentication.logout.LogoutHandler
A
RememberMeServices implementation that uses Spring Session backed
HttpSession to provide remember-me service capabilities.- Since:
- 1.3.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal org.springframework.security.core.AuthenticationautoLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) final voidloginFail(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) final voidloginSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication successfulAuthentication) voidlogout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) protected booleanrememberMeRequested(javax.servlet.http.HttpServletRequest request, String parameter) Allows customization of whether a remember-me login has been requested.voidsetAlwaysRemember(boolean alwaysRemember) voidsetRememberMeParameterName(String rememberMeParameterName) Set the name of the parameter which should be checked for to see if a remember-me has been requested during a login request.voidsetValiditySeconds(int validitySeconds)
-
Field Details
-
REMEMBER_ME_LOGIN_ATTR
Remember-me login request attribute name.
-
-
Constructor Details
-
SpringSessionRememberMeServices
public SpringSessionRememberMeServices()
-
-
Method Details
-
autoLogin
public final org.springframework.security.core.Authentication autoLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) - Specified by:
autoLoginin interfaceorg.springframework.security.web.authentication.RememberMeServices
-
loginFail
public final void loginFail(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) - Specified by:
loginFailin interfaceorg.springframework.security.web.authentication.RememberMeServices
-
loginSuccess
public final void loginSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication successfulAuthentication) - Specified by:
loginSuccessin interfaceorg.springframework.security.web.authentication.RememberMeServices
-
rememberMeRequested
protected boolean rememberMeRequested(javax.servlet.http.HttpServletRequest request, String parameter) Allows customization of whether a remember-me login has been requested. The default is to returntrueif the configured parameter name has been included in the request and is set to the valuetrue.- Parameters:
request- the request submitted from an interactive login, which may include additional information indicating that a persistent login is desired.parameter- the configured remember-me parameter name.- Returns:
- true if the request includes information indicating that a persistent login has been requested.
-
setRememberMeParameterName
Set the name of the parameter which should be checked for to see if a remember-me has been requested during a login request. This should be the same name you assign to the checkbox in your login form.- Parameters:
rememberMeParameterName- the request parameter
-
setAlwaysRemember
public void setAlwaysRemember(boolean alwaysRemember) -
setValiditySeconds
public void setValiditySeconds(int validitySeconds) -
logout
public void logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) - Specified by:
logoutin interfaceorg.springframework.security.web.authentication.logout.LogoutHandler
-