What is a JWT?
A JSON Web Token is three Base64URL strings joined by dots: header.payload.signature. The header names the signing algorithm, the payload holds claims such as the user ID and expiry, and the signature proves the token was issued by someone holding the key.
Anyone can read a JWT's payload; it is encoded, not encrypted. Never put passwords or secrets in it.
Standard claims
| Claim | Meaning |
|---|---|
iss | Issuer: who created the token |
sub | Subject: usually the user ID |
aud | Audience: who the token is for |
exp | Expiry time, in Unix seconds |
nbf | Not valid before this time |
iat | Issued at |
Decoding is not verifying
Decoding shows what a token says. Your server must still verify the signature, and check exp, aud and iss, before trusting it. This page can verify HMAC signatures (HS256, HS384, HS512) if you enter the secret. Tokens signed with RS256 or ES256 need the issuer's public key.