Arostik Logo
ArostikVLARCK

Micro-Technology Solutions

DEVELOPMENT & DATABASES

Decoder JWT & Signature Validator

Paste, decode, audit, verify and even generate JSON Web Tokens — without them ever leaving your browser.

100% local — this token is never sent to any server. Everything is processed right here, in your browser.

API Security & Identity

JSON Web Token Base64URL Anatomy, Registered Claims, and JWKS Verification

Local Execution (RAM-Only)

Across modern OAuth 2.0, OpenID Connect (OIDC), and REST or GraphQL microservice architectures, JSON Web Tokens (JWT, RFC 7519) carry verifiable identity assertions and authorization scopes without requiring a central session database lookup on every request. Inspecting headers, claims, and signatures locally eliminates guesswork when debugging `401 Unauthorized` responses.

Arostik's JWT Decoder parses the `Header.Payload.Signature` structure strictly inside volatile browser RAM using `Base64URL` decoding (RFC 4648 §5) and the browser Web Crypto API. No bearer tokens, HMAC secrets, or private test credentials ever leave your machine.

A common misconception around standard JWS tokens (RFC 7515) is assuming the payload is encrypted: in reality, `Header` and `Payload` are simply `Base64URL`-encoded JSON readable by anyone inspecting HTTP headers. Unless you explicitly wrap tokens with JWE encryption (RFC 7516), never store passwords, API secrets, or sensitive personal identifiers in JWT claims.

Auditing standard temporal claims—especially `exp` (expiration Unix seconds), `nbf` (not before), and `iat` (issued at)—alongside `iss` (issuer) and `aud` (audience) immediately exposes clock-skew rejections, expired bearer credentials, or misrouted tenant claims.

Step-by-Step JWT Debugging & Security Guide

Practical engineering checks for unexplained `401` rejections, JWKS key-rotation failures, `alg: none` vulnerabilities, and malformed Base64URL tokens:

1. API returns 401 Unauthorized right after issuing a fresh token

Root cause: NTP clock drift between the identity provider and API server (`iat`/`nbf` appears slightly in the future), or strict mismatch in `iss` (trailing slash) or `aud`.

Recommended resolution: Compare Unix timestamps `iat`, `nbf`, and `exp` against UTC, configure a small `clockTolerance` leeway (30–60s) on the API verifier, and match `iss`/`aud` verbatim.

echo '<PAYLOAD_B64>' | tr '_-' '/+' | base64 -d | jq .

2. RS256/ES256 signature verification suddenly breaks after Auth0, Cognito, or Keycloak key rotation

Root cause: Backend middleware cached a static PEM certificate instead of looking up the Header's `kid` dynamically via `/.well-known/jwks.json`.

Recommended resolution: Switch to a JWKS key resolver keyed by `kid` that refreshes upon encountering an unknown `kid`, while strictly pinning expected algorithms.

curl -s https://your-idp.com/.well-known/jwks.json | jq '.keys[] | {kid, alg, kty}'

3. Security audit flags 'alg: none' bypass or RS256-to-HS256 key confusion

Root cause: Verification library trusts the client-supplied `alg` header blindly, allowing attackers to strip signatures (`none`) or sign HMAC tokens using the public RSA key.

Recommended resolution: Enforce an explicit server-side algorithm allowlist (such as `algorithms: ['RS256']` or `['ES256']`) and reject `none` or mixed symmetric/asymmetric validation.

verify(token, publicKey, { algorithms: ['RS256'], issuer: '...', audience: '...' })

4. Decoder raises malformed JSON or invalid segment error when pasting a token

Root cause: Input includes a leading `Bearer ` prefix, stray quotes, line breaks, an opaque random token, or a 5-segment JWE encrypted token instead of 3-segment JWS.

Recommended resolution: Strip the leading `Bearer ` prefix so exactly three dot-separated segments remain (5 segments indicates encrypted JWE `Header.Key.IV.Ciphertext.Tag`).

echo '<JWT>' | awk -F. '{print NF " segments"}'

RFC 7519 (JWT) / RFC 7515 (JWS) / RFC 7517 (JWK)

RFC 7519 (JWT), RFC 7515 (JWS), Symmetric vs Asymmetric Signing, and JWK

Under RFC 7519 and RFC 7515 (JWS), a signed token consists of three unpadded `Base64URL` segments joined by periods: `Header` (declaring `alg`, `typ`, and optional `kid`), `Payload` (JSON claims object), and `Signature` computed over the exact ASCII string `base64url(Header) + '.' + base64url(Payload)`.

Choosing between symmetric (`HS256`/`HS512`) and asymmetric (`RS256`, `ES256`, `EdDSA`) algorithms defines how trust scales across teams. HMAC requires every verifying service to hold the identical shared signing secret, whereas RSA and ECDSA let the identity server retain the private key while microservices verify signatures using public keys fetched from JWK sets (RFC 7517).

To limit blast radius if a token leaks via client logs or browser storage, OAuth 2.1 security guidance favors short `exp` lifetimes (5–15 minutes) paired with rotating refresh tokens in `HttpOnly; Secure; SameSite` cookies and strict `iss`, `aud`, and `alg` validation on every resource server.

Quick Production JWT Security Check

Verify three invariants immediately: 1) explicit strong `alg` (`RS256`/`ES256`/`EdDSA`, never `none`), 2) zero passwords or unnecessary sensitive PII stored inside the Base64URL payload, and 3) short `exp` window validated alongside strict `iss`, `aud`, and JWKS `kid` checks.

Browser API Scope & Boundaries

Inspecting `Header` and `Payload` requires no secret key; cryptographic `Signature` verification in browser RAM requires supplying the matching HMAC secret or PEM/JWK public key, which stays strictly inside local memory.

JWT, JWS, JWK & OAuth Security Glossary

Essential terminology covering Base64URL encoding, claims `exp`/`iss`/`aud`, JWKS rotation, HMAC vs ECDSA, and JWE.

JSON Web Token (JWT)Auth

What is a JSON Web Token (JWT)?

An open standard (RFC 7519) securely representing authentication claims between two parties in a compact, URL-safe, digitally signed format.

Claims (Afirmaciones)Payload

What are Claims in a JWT payload?

Key-value statements inside the token payload payload expressing identity attributes, roles, and administrative metadata (e.g., `sub`, `exp`, `iss`).

Firma Criptográfica (Signature)Criptografía

Why is a JWT cryptographic signature necessary?

A cryptographic hash calculated over header and payload strings using a shared secret or private key, preventing data tampering in transit.

Expiración (Claim 'exp')Seguridad

What is the 'exp' claim timestamp?

A Unix epoch timestamp defining the exact second after which the authentication token must be rejected by backend API resource servers.

Frequently Asked Questions (FAQ)

Are claims inside a JWT encrypted against eavesdropping?

No—standard signed JWTs (JWS) use readable Base64URL encoding so any interceptor can decode claims without knowing the key. Use JWE (RFC 7516) when payload confidentiality is required.

Is it safe to decode production tokens in this browser tool?

Yes from a network standpoint: decoding and Web Crypto verification run 100% locally in browser RAM without uploading tokens to any backend. Still avoid sharing screenshots of live active tokens.

What is the practical difference between HS256 and RS256 / ES256?

`HS256` relies on a shared symmetric secret held by both issuer and verifier, whereas `RS256` and `ES256` use private signing keys paired with public keys published via `/.well-known/jwks.json`.

What role does the kid header field play during key rotation?

`kid` (Key ID) tells verifying microservices which public key entry inside a JWKS endpoint signed that specific token, enabling zero-downtime cryptographic key rotation.

Recommended Aros Student guide:Web Authentication Security and OWASP Hardening
Read guide