Interface Claims

All Superinterfaces:
Map<String,Object>

public interface Claims extends Map<String,Object>
The Claims interface represents JSON Web Token (JWT) payload claims and offers convenient get methods for some of the well known JWT claims such as "iss", "exp", and "iat".
Since:
1.0
  • Field Details

  • Method Details

    • getIssuer

      String getIssuer()
      Returns:
      The "iss" claim
    • getSubject

      String getSubject()
      Returns:
      The "sub" claim
    • getAudience

      List<String> getAudience()
      Returns:
      The "aud" claim
    • getExpiration

      long getExpiration()
      Returns:
      The "exp" claim
    • getNotBefore

      long getNotBefore()
      Returns:
      The "nbf" claim
    • getIssuedAt

      long getIssuedAt()
      Returns:
      The "iat" claim
    • getJwtId

      String getJwtId()
      Returns:
      The "jti" claim
    • getAuthorizedParty

      String getAuthorizedParty()
      Returns:
      The "azp" claim
    • getClaim

      <T> T getClaim(String claimName, Class<T> requiredType)
      Parameters:
      claimName - claim name
      requiredType - This is the required type of the claim value
      Returns:
      The claim value that matches the requiredType
    • getAllClaims

      Map<String,Object> getAllClaims()
      Returns:
      All the claims
    • toJsonString

      String toJsonString()
      Returns:
      All the claims in JSON string format