Class RememberMeAuthenticationToken

java.lang.Object
com.codename1.backend.security.AbstractAuthenticationToken
com.codename1.backend.security.RememberMeAuthenticationToken
All Implemented Interfaces:
Authentication

public class RememberMeAuthenticationToken extends AbstractAuthenticationToken

Who a request is from when the user was recognized by a remember-me cookie rather than signing in during this session.

It is authenticated, so authenticated() accepts it. fullyAuthenticated() and isFullyAuthenticated() do not: what should ask for the password again -- changing it, a payment -- uses those. A session that started from the cookie keeps this type for as long as it lasts.

  • Constructor Details

    • RememberMeAuthenticationToken

      public RememberMeAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities)
      Parameters:
      key - what identifies the services that made the token
    • RememberMeAuthenticationToken

      public RememberMeAuthenticationToken(String key, Object principal, Collection<? extends GrantedAuthority> authorities, boolean afterSecondFactor)
      Parameters:
      key - what identifies the services that made the token
      afterSecondFactor - whether the cookie was issued by a sign-in that passed a second factor; see isAfterSecondFactor()
  • Method Details

    • getKeyHash

      public int getKeyHash()
      The hash of the key the token was made with.
    • isAfterSecondFactor

      public boolean isAfterSecondFactor()
      Whether the sign-in that issued the cookie passed a second factor. On a chain that asks for one, a user who has a second factor is recognized by their cookie only when this is true.
    • getCredentials

      public Object getCredentials()
      Description copied from interface: Authentication
      What proves the principal is who it says: a password, usually, and null once it has been checked.
    • getPrincipal

      public Object getPrincipal()
      Description copied from interface: Authentication
      The identity: a username before authentication, and afterwards usually the UserDetails it was resolved to.