Package eu.webtoolkit.jwt.auth
Class OAuthAccessToken
java.lang.Object
eu.webtoolkit.jwt.auth.OAuthAccessToken
An OAuth access token.
A access token is the result of an authorization process, and encapsulates the authorization to access protected information.
Next to its getValue()
, it also contains optionally an
expires date and a refresh token.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefault constructor.OAuthAccessToken
(String accessToken, WDate expires, String refreshToken) Constructor.OAuthAccessToken
(String accessToken, WDate expires, String refreshToken, String idToken) Constructor with an OpenID Connect ID token. -
Method Summary
-
Field Details
-
Invalid
An invalid token constant.This is a token that is not
isValid()
.
-
-
Constructor Details
-
OAuthAccessToken
public OAuthAccessToken()Default constructor.Creates an invalid access token.
-
OAuthAccessToken
Constructor. -
OAuthAccessToken
Constructor with an OpenID Connect ID token.
-
-
Method Details
-
isValid
public boolean isValid()Returns whether the token is valid.An invalid access token is used to signal for example that the user denied the authorization request.
-
getValue
Returns the access token value.This value can be used to access protected resources.
-
expires
Returns the token expires time (if available).Returns null if not available.
-
getRefreshToken
Returns the refresh token (if available).The refresh token is an optional token that can be used when the access token has expired.
If not available, returns an empty string.
-
getIdToken
-