Class TokenStorage
java.lang.Object
ml.karmaconfigs.api.common.utils.security.token.TokenStorage
Karma token storage
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TokenStorage
Initialize the token storage- Parameters:
src- the token source
-
-
Method Details
-
destroy
Destroy a token- Parameters:
tokenID- the token IDpassword- the token password
-
store
Store a token- Parameters:
token- the tokenpassword- the token passwordexpiration- the token expiration date (null for no expiration)- Returns:
- the token ID
-
load
public String load(UUID tokenID, String password) throws TokenNotFoundException, TokenExpiredException, TokenIncorrectPasswordExceptionLoad a token- Parameters:
tokenID- the token IDpassword- the token password- Returns:
- the token
- Throws:
TokenNotFoundException- if the token couldn't be foundTokenExpiredException- if the token is expiredTokenIncorrectPasswordException- if the token password's is incorrect
-
expiration
Get the token expiration date- Parameters:
tokenID- the token ID- Returns:
- the token expiration date
-