public class SpringSessionRememberMeServices
extends java.lang.Object
implements org.springframework.security.web.authentication.RememberMeServices, org.springframework.security.web.authentication.logout.LogoutHandler
RememberMeServices
implementation that uses Spring Session backed
HttpSession
to provide remember-me service capabilities.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REMEMBER_ME_LOGIN_ATTR
Remember-me login request attribute name.
|
Constructor and Description |
---|
SpringSessionRememberMeServices() |
Modifier and Type | Method and Description |
---|---|
org.springframework.security.core.Authentication |
autoLogin(HttpServletRequest request,
HttpServletResponse response) |
void |
loginFail(HttpServletRequest request,
HttpServletResponse response) |
void |
loginSuccess(HttpServletRequest request,
HttpServletResponse response,
org.springframework.security.core.Authentication successfulAuthentication) |
void |
logout(HttpServletRequest request,
HttpServletResponse response,
org.springframework.security.core.Authentication authentication) |
protected boolean |
rememberMeRequested(HttpServletRequest request,
java.lang.String parameter)
Allows customization of whether a remember-me login has been requested.
|
void |
setAlwaysRemember(boolean alwaysRemember) |
void |
setRememberMeParameterName(java.lang.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) |
public static final java.lang.String REMEMBER_ME_LOGIN_ATTR
public final org.springframework.security.core.Authentication autoLogin(HttpServletRequest request, HttpServletResponse response)
autoLogin
in interface org.springframework.security.web.authentication.RememberMeServices
public final void loginFail(HttpServletRequest request, HttpServletResponse response)
loginFail
in interface org.springframework.security.web.authentication.RememberMeServices
public final void loginSuccess(HttpServletRequest request, HttpServletResponse response, org.springframework.security.core.Authentication successfulAuthentication)
loginSuccess
in interface org.springframework.security.web.authentication.RememberMeServices
protected boolean rememberMeRequested(HttpServletRequest request, java.lang.String parameter)
true
if the configured parameter name has been included in the
request and is set to the value true
.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.public void setRememberMeParameterName(java.lang.String rememberMeParameterName)
rememberMeParameterName
- the request parameterpublic void setAlwaysRemember(boolean alwaysRemember)
public void setValiditySeconds(int validitySeconds)
public void logout(HttpServletRequest request, HttpServletResponse response, org.springframework.security.core.Authentication authentication)
logout
in interface org.springframework.security.web.authentication.logout.LogoutHandler