Class Token
- java.lang.Object
-
- eu.webtoolkit.jwt.auth.Token
-
public class Token extends java.lang.ObjectAn authentication token hash.An authentication token is a surrogate for identification or authentication. When a random authentication token is generated, it is a good practice to hash it using a cryptographic hash function, and only save this hash in the session or database for later verification. This avoids that a compromised database would leak all the authentication tokens.
The token can be used for multiple purposes, denoted by the token's name in the browser. In both cases it is used for "remember-me" functionality. For regular authentication this is for the normal username/password combination login. For MFA authentication this is used in a similar fashion to remember the MFA verification. That means a
Userwill not have to submit a TOTP code each time they log in. But only as often as the developer desires (managed byAuthService#setMfaTokenValidity()).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WDategetExpirationTime()Returns the expiration time.java.lang.StringgetHash()Returns the hash.booleanisEmpty()Returns whether the token is empty.
-
-
-
Constructor Detail
-
Token
public Token()
Default constructor.Creates an empty token.
-
Token
public Token(java.lang.String hash, WDate expirationTime)
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Returns whether the token is empty.An empty token is default constructed.
-
getHash
public java.lang.String getHash()
Returns the hash.
-
getExpirationTime
public WDate getExpirationTime()
Returns the expiration time.
-
-