Anatomy of a JWT
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.SflKxwRJSMeKKF2QT4fw
HEADER . PAYLOAD . SIGNATURE
A JWT consists of three Base64URL-encoded segments separated by dots. The header declares the signing algorithm (HS256, RS256, ES256). The payloadcontains claims — key-value pairs carrying data like user ID, roles, and expiration time. The signature is computed over the header and payload using a secret key, preventing tampering. Decoding reveals the first two parts; only the server with the key can verify the third.