Class PersistentRememberMeToken

java.lang.Object
com.codename1.backend.security.rememberme.PersistentRememberMeToken

public final class PersistentRememberMeToken extends Object
One remembered sign-in, as the server keeps it: whose it is, the series the cookie names, the hash of the token the cookie must carry next, and when it was last used.
  • Constructor Details

    • PersistentRememberMeToken

      public PersistentRememberMeToken(String username, String series, String tokenHash, long lastUsed)
      Parameters:
      tokenHash - the SHA-256 of the token, in hex: the token itself is only ever in the cookie
      lastUsed - epoch milliseconds
    • PersistentRememberMeToken

      public PersistentRememberMeToken(String username, String series, String tokenHash, long lastUsed, String previousTokenHash)
      Includes the token replaced at lastUsed, for a bounded concurrent-use grace.
    • PersistentRememberMeToken

      public PersistentRememberMeToken(String username, String series, String tokenHash, long lastUsed, String previousTokenHash, String userAgent, String ipAddress)

      A token with the device it was issued to, for a "signed-in devices" page.

      Parameters
      • userAgent: the User-Agent of the sign-in, or null
      • ipAddress: the client address of the sign-in, or null
  • Method Details

    • getUsername

      public String getUsername()
    • getSeries

      public String getSeries()
    • getTokenHash

      public String getTokenHash()
    • getLastUsed

      public long getLastUsed()
    • getPreviousTokenHash

      public String getPreviousTokenHash()
      The hash replaced at getLastUsed(), or null before the first rotation.
    • getUserAgent

      public String getUserAgent()
      The User-Agent the series was issued to, or null when it was not recorded.
    • getIpAddress

      public String getIpAddress()
      The client address the series was issued to, or null when it was not recorded. It is the address at sign-in; the series may since be used from another.