Class OAuthAccessToken

java.lang.Object
eu.webtoolkit.jwt.auth.OAuthAccessToken

public class OAuthAccessToken extends Object
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.

See Also:
  • Field Details

  • Constructor Details

    • OAuthAccessToken

      public OAuthAccessToken()
      Default constructor.

      Creates an invalid access token.

    • OAuthAccessToken

      public OAuthAccessToken(String accessToken, WDate expires, String refreshToken)
      Constructor.
    • OAuthAccessToken

      public OAuthAccessToken(String accessToken, WDate expires, String refreshToken, String idToken)
      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

      public String getValue()
      Returns the access token value.

      This value can be used to access protected resources.

    • expires

      public WDate expires()
      Returns the token expires time (if available).

      Returns null if not available.

    • getRefreshToken

      public String 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

      public String getIdToken()