Class IssuedToken

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

public class IssuedToken extends Object
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 Details

    • IssuedToken

      public IssuedToken()
      Default constructor.

      Creates an invalid token.

      See Also:
    • IssuedToken

      public IssuedToken(String id, AbstractUserDatabase userDatabase)
      Constructor.

      Creates a user with id id, and whose information is stored in the database.

  • 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

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

      public String getValue()
      Retrieves the string value that represents this token, usually random characters.
    • getExpirationTime

      public WDate getExpirationTime()
      Retrieves the time when the token expires.
    • getPurpose

      public String getPurpose()
      Retrieves the purpose of this token: authenication code, access token or refresh token.
    • getScope

      public String getScope()
      Retrieves the scope of this token as a space-separated string.
    • getRedirectUri

      public String getRedirectUri()
      Retrieves the valid redirect uri of this token.
    • getUser

      public User getUser()
      Retrieves the user that is associated with this token.
    • getAuthClient

      public OAuthClient getAuthClient()
      Retrieves the client for which this token was issued.