Package eu.webtoolkit.jwt.auth
Class IssuedToken
java.lang.Object
eu.webtoolkit.jwt.auth.IssuedToken
Token
or authorization code that was issued to a relying party.
This class represents an access token. It is a value class that stores only the id and a
reference to an AbstractUserDatabase
to access its properties.
An object can point to a valid token, or be invalid. Invalid tokens are typically used as return value for database queries which did not match with an existing client.
- See Also:
-
Constructor Summary
ConstructorDescriptionDefault constructor.IssuedToken
(String id, AbstractUserDatabase userDatabase) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the client for which this token was issued.Retrieves the time when the token expires.getId()
Returns the user id.Retrieves the purpose of this token: authenication code, access token or refresh token.Retrieves the valid redirect uri of this token.getScope()
Retrieves the scope of this token as a space-separated string.getUser()
Retrieves the user that is associated with this token.getValue()
Retrieves the string value that represents this token, usually random characters.boolean
Returns whether the token is valid.
-
Constructor Details
-
IssuedToken
public IssuedToken()Default constructor.Creates an invalid token.
- See Also:
-
IssuedToken
Constructor.Creates a user with id
id
, and whose information is stored in thedatabase
.
-
-
Method Details
-
isCheckValid
public boolean isCheckValid()Returns whether the token is valid.A invalid token is a sentinel value returned by methods that query the database but could not identify a matching user.
-
getId
Returns the user id.This returns the id that uniquely identifies the token, and acts as a "primary key" to obtain other information for the token in the database.
- See Also:
-
getValue
Retrieves the string value that represents this token, usually random characters. -
getExpirationTime
Retrieves the time when the token expires. -
getPurpose
Retrieves the purpose of this token: authenication code, access token or refresh token. -
getScope
Retrieves the scope of this token as a space-separated string. -
getRedirectUri
Retrieves the valid redirect uri of this token. -
getUser
Retrieves the user that is associated with this token. -
getAuthClient
Retrieves the client for which this token was issued.
-