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(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
loginFail(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
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,
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(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
autoLogin
in interface org.springframework.security.web.authentication.RememberMeServices
public final void loginFail(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
loginFail
in interface org.springframework.security.web.authentication.RememberMeServices
public final void loginSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication successfulAuthentication)
loginSuccess
in interface org.springframework.security.web.authentication.RememberMeServices
protected boolean rememberMeRequested(javax.servlet.http.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(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
logout
in interface org.springframework.security.web.authentication.logout.LogoutHandler