Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class PersistentRememberMeToken
- Object
- 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
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
usernameString- Not documented.
seriesString- Not documented.
tokenHashString- the SHA-256 of the token, in hex: the token itself is only ever in the cookie
lastUsedlong- 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
usernameString- Not documented.
seriesString- Not documented.
tokenHashString- Not documented.
lastUsedlong- Not documented.
previousTokenHashString- Not documented.
userAgentString- the
User-Agentof the sign-in, or null ipAddressString- 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.