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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal org.springframework.security.core.Authentication
autoLogin
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) final void
loginFail
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) final void
loginSuccess
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication successfulAuthentication) void
logout
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) protected boolean
rememberMeRequested
(javax.servlet.http.HttpServletRequest request, String parameter) Allows customization of whether a remember-me login has been requested.void
setAlwaysRemember
(boolean alwaysRemember) void
setRememberMeParameterName
(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.void
setValiditySeconds
(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:
autoLogin
in interfaceorg.springframework.security.web.authentication.RememberMeServices
-
loginFail
public final void loginFail(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) - Specified by:
loginFail
in 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:
loginSuccess
in 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 returntrue
if 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:
logout
in interfaceorg.springframework.security.web.authentication.logout.LogoutHandler
-