All Superinterfaces:
Activatable<TokenStatus>

public interface Token extends Activatable<TokenStatus>
A token that can be used to authorize access to resources without checking with an authorization server.

Tokens are issued based on a Delegation.

  • Method Details

    • getTokenHash

      String getTokenHash()
      Returns:
      a hash representation of this token. This may be an opaque String which has no meaning to anyone but the token issuer that created the token, or it may be an actual serialized form of this token, like a JWT, for example.
    • getId

      Returns:
      the optional ID of this token.
    • getDelegationsId

      String getDelegationsId()
      Returns:
      the ID of the delegation upon which this token is based.
    • getPurpose

      String getPurpose()
      Returns:
      the purpose of this token.
    • getUsage

      String getUsage()
      Returns:
      the usage of this token.
    • getFormat

      String getFormat()
      Returns:
      the format of this token.
    • getScope

      Returns:
      the optional scopes of this token as a whitespace-separated String.
    • getCreated

      long getCreated()
      Returns:
      the time this token was created, in epoch-seconds.
    • getExpires

      long getExpires()
      Specified by:
      getExpires in interface Activatable<TokenStatus>
      Returns:
      the time this token expires, in epoch-seconds.
    • getStatus

      TokenStatus getStatus()
      Specified by:
      getStatus in interface Activatable<TokenStatus>
      Returns:
      the current status of this token.
    • getIssuer

      String getIssuer()
      Returns:
      the issuer of this token.
    • getSubject

      String getSubject()
      Returns:
      the subject of this token.
    • getAudience

      StringOrArray getAudience()
      Returns:
      the audiences of this token as a StringOrArray type
    • getNotBefore

      long getNotBefore()
      Returns:
      the earliest time at which this token may be used, in epoch-seconds.
    • getData

      Map<String,Object> getData()
      Returns:
      the data given by the token issuer upon the creation of this token instance.

      What this data represents and how to interpret it is up to the token issuer and may depend on the token type.