JWT Specifications

Technical details and specifications for JSON Web Tokens (JWT)

JSON Web Token (JWT)
RFC 7519 - JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties.

Structure

A JWT consists of three parts separated by dots (.), which are:

  • Header - Typically consists of two parts: the type of the token (JWT) and the signing algorithm being used (e.g., HMAC SHA256 or RSA).
  • Payload - Contains the claims. Claims are statements about an entity (typically, the user) and additional data.
  • Signature - To create the signature part, you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that.

Example JWT

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Standard Claims

ClaimDescription
issIssuer of the JWT
subSubject of the JWT (the user)
audAudience of the JWT
expExpiration time
nbfNot before time
iatIssued at time
jtiJWT ID