Category · 1 tool · 1 guide
JWT, auth and security tools
Authentication is where small mistakes become incidents. Login flows, session tokens, API keys, OAuth redirects and signed webhooks all depend on getting exact details right: the algorithm, the secret, the expiry time, the audience, the clock on the server. When something fails, the error is usually a terse 401 that hides the real reason.
JSON Web Tokens are the most common credential format you will debug. A JWT is readable by anyone, so you can learn a lot by decoding it: who issued it, who it is for, when it expires and which algorithm signed it. Verifying the signature with the right key tells you whether the token is genuine or was changed.
Because tokens and secrets grant real access, tools in this category run entirely in your browser. Nothing you paste is logged or sent to a server. Even so, prefer test tokens over production ones whenever you can.
Tools in this category
Common tasks
- Find out why an API returns 401Decode the token your client sends and check whether it has expired, has the wrong audience or is missing a scope.
- Confirm a token was signed with your secretVerify the HMAC signature to rule out a wrong secret or an algorithm mismatch between services.
- Learn what a server must checkGo through signature, algorithm, issuer, audience and expiry validation before trusting a token in your own code.
- Decode a Base64URL segment by handUnderstand the encoding JWTs use for each part and why it is not encryption.
- Test an endpoint with a bearer tokenSend a request with an Authorization header and see exactly how the server responds.
Key concepts
- JWT
- A JSON Web Token has three Base64URL parts separated by dots: a header, a payload of claims and a signature. The header and payload are only encoded, not encrypted, so never put secrets in them.
- Claims
- The fields in the payload. Registered claims include iss (issuer), sub (subject), aud (audience), exp (expiry), nbf (not before) and iat (issued at). Times are Unix timestamps in seconds.
- HS256 vs RS256
- HS256 signs with a shared secret, so every service that verifies tokens can also create them. RS256 and ES256 sign with a private key and verify with a public key, which suits tokens checked by many services.
- Clock skew
- Servers rarely have perfectly synced clocks. Validators usually allow a leeway of 30 to 60 seconds on exp and nbf so a freshly issued token is not rejected as "not yet valid".
- alg: none
- An unsigned token type allowed by the spec. Libraries must reject it, and must not let the token header choose the algorithm, or attackers can forge tokens.
Best practices
- Pin the expected algorithm when verifying tokens; never trust the alg value in the token header alone.
- Keep access tokens short-lived, around 5 to 15 minutes, and use refresh tokens or sessions to get new ones.
- Always validate exp, iss and aud, not just the signature. A valid signature on a token meant for another service is still the wrong token.
- Use secrets of at least 256 random bits for HMAC algorithms and rotate them with a key ID (kid) so old and new keys can overlap.
- Store browser tokens in HttpOnly, Secure cookies where possible to keep them away from injected scripts.