Class DefaultJwt

java.lang.Object
com.okta.jwt.impl.DefaultJwt
All Implemented Interfaces:
Jwt

public class DefaultJwt extends Object implements Jwt
Default simple bean implementation of Jwt. Classes in this `impl` implementation package may change in NON backward compatible way, and should ONLY be used as a "runtime" dependency.
  • Constructor Details

    • DefaultJwt

      public DefaultJwt(String tokenValue, Instant issuedAt, Instant expiresAt, Map<String,Object> claims)
      Creates an instance based on input from an already parsed and validated JWT.
      Parameters:
      tokenValue - Original JWT string
      issuedAt - The value from the iat claim, as an Instant
      expiresAt - The value from the exp claim, as an Instant
      claims - A map of the original claim values in the JWT
  • Method Details

    • getTokenValue

      public String getTokenValue()
      Description copied from interface: Jwt
      Returns the original string representation of this JWT.
      Specified by:
      getTokenValue in interface Jwt
      Returns:
      original JWT string representation
    • getIssuedAt

      public Instant getIssuedAt()
      Description copied from interface: Jwt
      Returns the `iat` claim value as an Instant.
      Specified by:
      getIssuedAt in interface Jwt
      Returns:
      `iat` claim value
    • getExpiresAt

      public Instant getExpiresAt()
      Description copied from interface: Jwt
      Returns the `exp` claim value as an Instant.
      Specified by:
      getExpiresAt in interface Jwt
      Returns:
      `exp` claim value
    • getClaims

      public Map<String,Object> getClaims()
      Description copied from interface: Jwt
      Returns the token body clams as Map.
      Specified by:
      getClaims in interface Jwt
      Returns:
      the token body clams as Map