DEV Community

Abhishek Tiwari for Axioms

Posted on

Introducing JWT Debugger App

JSON Web Token is a compact yet URL-safe token primarily used for OAuth 2 and OpenID based authentication and authorization. A JWT token represents a set of claims as a JSON object that is encoded in a JSON Web Signature (JWS) structure.

JWT Token

A JWT token is made of three URL-safe portions header, payload, and signature separated by period ('.') characters. Each component contains a base64url-encoded value. For instance, the following string represents a JWT token


Decoding a token

When you decode a JWT token you get a JSON header and JSON payload. The overall token decoding process is really straightforward. You take the first portion, Base64url decode it and remove any line breaks, whitespace, or other additional characters which gives you header. You take the second portion and Base64url decode it and remove any line breaks, whitespace, or other additional characters which gives you payload.

// Token Header decoded from eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
 "alg": "HS256",
 "typ": "JWT"
// Token Payload decoded from eyJzdWIiOiJ1czNvcmphczc5bDAzOHBrMWJwNmoxZCIsIm5hbWUiOiJKb2huIERvZSIsImp0aSI6Ijc4ZjRnMWpkam5naTBpMzJveGtuZCIsImV4cCI6MTU5MDc2OTE1OH0
  "name":"John Doe",

Token validation

Validation of the token requires signing key or secrete used to create the signature portion of the token. Signing algorithm is described by alg claim the token header.

  • If the signing algorithm belongs the family of asymmetrical algorithms i.e. Rivest–Shamir–Adleman (RSA) or Elliptic Curve Digital Signature Algorithm (ECDSA) then you will need the public version of the private key used for token signing. The public key can be in JSON Web Key (JWK) format or PEM format. If you are using an OpenID Connect compliant authorizations server then the public side of JWK keys are served by a JSON Web Key Set (JWKS) endpoint. A JWKS endpoint returns a set of keys which contains the one or more public keys.
  • If the signing algorithm belongs to the family of symmetrical algorithms HMAC (sometimes expanded as either keyed-hash message authentication code or hash-based message authentication code) you will need the shared key or secret used to sign the token.

Here is an example of JWKS endpoint of Google OAuth 2 server. JWKS endpoint may return more than one public key so you identify relevant key matching the kid parameter of token header and JWK key.


Finally, the use of JWKS endpoint for token validation is recommended as it is safe and does not require sharing of the secret key between parties.

Use a JWT Debugger

If you are a developer working with JWT tokens then most likely you use a debugger tool to decode and validate your token. is probably one of the most popular out there. is an amazing tool but if you are working with sensitive tokens probably you want to avoid pasting them online which is why we created a cross-platform interactive JWT Debugger App.

JWT Debugger App Web Version with PWA Support

With JWT Debugger App, use the web version as a progressive web app or install desktop apps for Mac, Window, and Linux. More importantly, [JWT Debugger App] supports token validation using both JWKS Endpoint and PEM/Secret Keys. and many other JWT tools currently don't support JWKS Endpoint based token validation.

JWT Debugger App Desktop Version

JWT Debugger App itself is open-source and if you find any issues or like to add a feature just open a Github ticket and we will love to help.

Top comments (0)