Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class PersistentRememberMeToken

  1. Object
  2. PersistentRememberMeToken
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.

Constructors

public PersistentRememberMeToken(String username, String series, String tokenHash, long lastUsed)
public PersistentRememberMeToken(String username, String series, String tokenHash, long lastUsed, String previousTokenHash)Includes the token replaced at lastUsed, for a bounded concurrent-use grace.
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.

Methods

public String getUsername()
public String getSeries()
public String getTokenHash()
public long getLastUsed()
public String getPreviousTokenHash()The hash replaced at getLastUsed(), or null before the first rotation.
public String getUserAgent()The User-Agent the series was issued to, or null when it was not recorded.
public String getIpAddress()The client address the series was issued to, or null when it was not recorded.

Inherited methods

Constructor details

PersistentRememberMeToken

public PersistentRememberMeToken(String username, String series, String tokenHash, long lastUsed)

Parameters

username String
Not documented.
series String
Not documented.
tokenHash String
the SHA-256 of the token, in hex: the token itself is only ever in the cookie
lastUsed long
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

username String
Not documented.
series String
Not documented.
tokenHash String
Not documented.
lastUsed long
Not documented.
previousTokenHash String
Not documented.
userAgent String
the User-Agent of the sign-in, or null
ipAddress String
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.