Interface JsonWebToken

All Known Implementing Classes:
AbstractJsonWebToken, ImmutableJsonWebToken

public interface JsonWebToken
Representation for a JSON Web Token.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    An enumeration of the known JsonFields of a JSON Web Token.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the audience of the token.
    Returns the authorized party of the token.
    org.eclipse.ditto.json.JsonObject
    Returns the body JSON object of the token.
    Returns the expiration time of the token.
    org.eclipse.ditto.json.JsonObject
    Returns the header JSON object of the token.
    Returns the issuer of the token.
    Returns identifier of the key.
    Returns the scopes of the token.
    Returns the signature of the token.
    Returns the subjects which can be used for authorization, e.g. the "sub" claim.
    Returns the encoded token.
    boolean
    Returns true if the token is expired.
  • Method Details

    • getToken

      String getToken()
      Returns the encoded token.
      Returns:
      the token.
    • getHeader

      org.eclipse.ditto.json.JsonObject getHeader()
      Returns the header JSON object of the token.
      Returns:
      the header JSON.
    • getBody

      org.eclipse.ditto.json.JsonObject getBody()
      Returns the body JSON object of the token.
      Returns:
      the body JSON.
    • getKeyId

      String getKeyId()
      Returns identifier of the key.
      Returns:
      the identifier.
    • getIssuer

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

      String getSignature()
      Returns the signature of the token.
      Returns:
      the signature.
    • getSubjects

      List<String> getSubjects()
      Returns the subjects which can be used for authorization, e.g. the "sub" claim.
      Returns:
      the subjects.
    • getAudience

      Audience getAudience()
      Returns the audience of the token.
      Returns:
      the audience.
    • getAuthorizedParty

      String getAuthorizedParty()
      Returns the authorized party of the token.
      Returns:
      the authorized party.
    • getScopes

      List<String> getScopes()
      Returns the scopes of the token.
      Returns:
      the scopes.
    • getExpirationTime

      Instant getExpirationTime()
      Returns the expiration time of the token.
      Returns:
      the expiration time.
    • isExpired

      boolean isExpired()
      Returns true if the token is expired.
      Returns:
      true if token is expired otherwise false.