Class RememberMeManagerImpl
java.lang.Object
org.craftercms.security.authentication.impl.RememberMeManagerImpl
- All Implemented Interfaces:
RememberMeManager
Default implementation of
RememberMeManager
.- Author:
- avasquez
-
Field Summary
Modifier and TypeFieldDescriptionprotected AuthenticationManager
protected org.craftercms.profile.api.services.AuthenticationService
protected org.craftercms.commons.crypto.TextEncryptor
protected org.craftercms.profile.api.services.ProfileService
static final String
protected org.craftercms.commons.http.CookieManager
static final char
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addRememberMeCookie
(String cookieValue, javax.servlet.http.HttpServletResponse response) protected Authentication
authenticate
(String profileId) autoLogin
(org.craftercms.commons.http.RequestContext context) Attempts auto login if a remember me cookie is present in the current requestprotected void
deleteRememberMeCookie
(javax.servlet.http.HttpServletResponse response) protected org.craftercms.profile.api.PersistentLogin
deserializeLogin
(String serializedLogin) protected void
disableRememberMe
(String loginId, org.craftercms.commons.http.RequestContext context) void
disableRememberMe
(org.craftercms.commons.http.RequestContext context) Disabled remember me for the current authenticated profile, generally by removing remember me cookie.void
enableRememberMe
(Authentication authentication, org.craftercms.commons.http.RequestContext context) Enables remember me for the current authenticated profile, generally by adding a remember me cookie.protected org.craftercms.profile.api.PersistentLogin
getPersistentLoginFromCookie
(javax.servlet.http.HttpServletRequest request) protected String
getRememberMeCookie
(javax.servlet.http.HttpServletRequest request) protected String
serializeLogin
(org.craftercms.profile.api.PersistentLogin login) void
setAuthenticationManager
(AuthenticationManager authenticationManager) void
setAuthenticationService
(org.craftercms.profile.api.services.AuthenticationService authenticationService) void
setEncryptor
(org.craftercms.commons.crypto.TextEncryptor encryptor) void
setProfileService
(org.craftercms.profile.api.services.ProfileService profileService) void
setRememberMeCookieManager
(org.craftercms.commons.http.CookieManager rememberMeCookieManager) protected void
updateRememberMe
(String loginId, org.craftercms.commons.http.RequestContext context)
-
Field Details
-
REMEMBER_ME_COOKIE_NAME
- See Also:
-
SERIALIZED_LOGIN_SEPARATOR
public static final char SERIALIZED_LOGIN_SEPARATOR- See Also:
-
authenticationService
protected org.craftercms.profile.api.services.AuthenticationService authenticationService -
authenticationManager
-
profileService
protected org.craftercms.profile.api.services.ProfileService profileService -
encryptor
protected org.craftercms.commons.crypto.TextEncryptor encryptor -
rememberMeCookieManager
protected org.craftercms.commons.http.CookieManager rememberMeCookieManager
-
-
Constructor Details
-
RememberMeManagerImpl
public RememberMeManagerImpl()
-
-
Method Details
-
setAuthenticationService
public void setAuthenticationService(org.craftercms.profile.api.services.AuthenticationService authenticationService) -
setAuthenticationManager
-
setProfileService
public void setProfileService(org.craftercms.profile.api.services.ProfileService profileService) -
setEncryptor
public void setEncryptor(org.craftercms.commons.crypto.TextEncryptor encryptor) -
setRememberMeCookieManager
public void setRememberMeCookieManager(org.craftercms.commons.http.CookieManager rememberMeCookieManager) -
autoLogin
public Authentication autoLogin(org.craftercms.commons.http.RequestContext context) throws RememberMeException Description copied from interface:RememberMeManager
Attempts auto login if a remember me cookie is present in the current request- Specified by:
autoLogin
in interfaceRememberMeManager
- Parameters:
context
- the request context- Returns:
- the authentication if auto login was successful
- Throws:
RememberMeException
-
enableRememberMe
public void enableRememberMe(Authentication authentication, org.craftercms.commons.http.RequestContext context) throws RememberMeException Description copied from interface:RememberMeManager
Enables remember me for the current authenticated profile, generally by adding a remember me cookie.- Specified by:
enableRememberMe
in interfaceRememberMeManager
- Parameters:
authentication
- the authentication objectcontext
- the request context- Throws:
RememberMeException
-
disableRememberMe
public void disableRememberMe(org.craftercms.commons.http.RequestContext context) throws RememberMeException Description copied from interface:RememberMeManager
Disabled remember me for the current authenticated profile, generally by removing remember me cookie.- Specified by:
disableRememberMe
in interfaceRememberMeManager
- Parameters:
context
- the request context- Throws:
RememberMeException
-
disableRememberMe
protected void disableRememberMe(String loginId, org.craftercms.commons.http.RequestContext context) throws RememberMeException - Throws:
RememberMeException
-
updateRememberMe
protected void updateRememberMe(String loginId, org.craftercms.commons.http.RequestContext context) throws RememberMeException - Throws:
RememberMeException
-
serializeLogin
protected String serializeLogin(org.craftercms.profile.api.PersistentLogin login) throws RememberMeException - Throws:
RememberMeException
-
deserializeLogin
protected org.craftercms.profile.api.PersistentLogin deserializeLogin(String serializedLogin) throws RememberMeException - Throws:
RememberMeException
-
addRememberMeCookie
protected void addRememberMeCookie(String cookieValue, javax.servlet.http.HttpServletResponse response) -
getRememberMeCookie
-
deleteRememberMeCookie
protected void deleteRememberMeCookie(javax.servlet.http.HttpServletResponse response) -
getPersistentLoginFromCookie
protected org.craftercms.profile.api.PersistentLogin getPersistentLoginFromCookie(javax.servlet.http.HttpServletRequest request) -
authenticate
- Throws:
AuthenticationException
-