Class RememberMeManagerImpl

java.lang.Object
org.craftercms.security.authentication.impl.RememberMeManagerImpl
All Implemented Interfaces:
RememberMeManager

public class RememberMeManagerImpl extends Object implements RememberMeManager
Default implementation of RememberMeManager.
Author:
avasquez
  • Field Details

    • SERIALIZED_LOGIN_SEPARATOR

      public static final char SERIALIZED_LOGIN_SEPARATOR
      See Also:
    • authenticationService

      protected org.craftercms.profile.api.services.AuthenticationService authenticationService
    • authenticationManager

      protected AuthenticationManager 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

      public void setAuthenticationManager(AuthenticationManager authenticationManager)
    • 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 interface RememberMeManager
      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 interface RememberMeManager
      Parameters:
      authentication - the authentication object
      context - 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 interface RememberMeManager
      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

      protected String getRememberMeCookie(javax.servlet.http.HttpServletRequest request)
    • deleteRememberMeCookie

      protected void deleteRememberMeCookie(javax.servlet.http.HttpServletResponse response)
    • getPersistentLoginFromCookie

      protected org.craftercms.profile.api.PersistentLogin getPersistentLoginFromCookie(javax.servlet.http.HttpServletRequest request)
    • authenticate

      protected Authentication authenticate(String profileId) throws AuthenticationException
      Throws:
      AuthenticationException