This blog aims at providing quick reference over the JWT claims and meta information because they are often presented short in three letters to keep them compact. To follow the blog intermediate security knowledge is required.

The oversimplified JWT definition:

JWT has three components.


Sample JWT in the image below:

  1. Base64 – The metadata (or header or manifest) that includes how the token is structured, signed, and so on.
  2. Base64 – Claims is what provides the actual meaning of the token.
  3. Base64 – Signature intends to provide authenticity and integrity. describes the registered claims for JWT. An identify provider has the flexibility to add claims that are specific for the intended situations.

Exploring JWT header:

Let’s look at the following JWT sample (base64 decoded) that has the below header information. We will explore the data section subsequently.

RFC reference – (JSON Web Signature)

In the above example typ indicates the token type that is JWT

alg indicates the algorithm type of algorithm used to sign the JWT token. Most commonly used values are RS256, HS256 which stand for RSA-SHA256 (asymmetric) and HMAC-SHA256 (symmetric) respectively.

RS256 alg belongs to the RSA kty (read the kty section below)

x5t is the X509 certificate’s thumbprint. That is the certificate whose private key was used to sign the JWT

kid id the key id indicating which key was used to sign the JWT token. This field is particularly useful when the public key discovery endpoint supports many keys and we need to know which key was used to sign.

In order to verify the signature of the JWT token, the verifier needs to know the public key of the public /private key pair used to sign the JTW token. Most identify providers expose this information via discovery mechanisms such as the one below from Microsoft Azure.

In the above example:

If the key type that is the algorithm family used to sign the JWT. RSA, EC are some allowed kty. RS256, RS512 are some algorithms (alg) that belong to the RSA algorithm family (kty)

whether the algorithm is used for enc encryption or sig signing

x5t and kid:
explained above

public key component of the RSA –

public key component of the RSA –

[Note: If the algorithm kty is EC (elliptic Curve) then the public components are x and y]

the x509 certificate chain

The next blog will provide reference information for a sample JWT token from Azure AD.

Credits and References:


Please enter your comment!
Please enter your name here