Anatomy of a JWT
A JWT is three URL-safe base64 segments separated by dots:
header.payload.signature- Header — JSON describing the algorithm (
alg) and token type (typ). Often alsokid(key id) for rotation. - Payload — JSON claims. Registered claims (iss, sub, aud, exp, nbf, iat, jti) plus any private claims your app adds.
- Signature — raw signature bytes, base64url-encoded. Verifies the header + payload haven't been tampered with.
The header and payload are encoded, not encrypted. Treat anything you put in the payload as public.