An RFC 7519 JSON Web Token transmitted in JWS Compact Serialization consists of three unpadded Base64URL strings joined by periods: <header>.<payload>.<signature>. If you copy an HTTP header value such as Authorization: Bearer <token>, the decoder strips the leading Bearer scheme prefix before splitting on ..
Consider this standard HS256-signed compact token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
1. Decoded JOSE Protected Header
Base64URL-decoding the first segment (eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9) yields 27 UTF-8 bytes describing the cryptographic algorithm and media type:
{
"alg": "HS256",
"typ": "JWT"
}
2. Decoded Claims Payload & NumericDate Timestamps
Base64URL-decoding the second segment (eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ) reveals the JSON claims set:
{
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
}
Here iat (1516239022) resolves to 2018-01-18T01:30:22Z in UTC. When inspecting a production access token that includes full lifecycle bounds, the inspector evaluates each NumericDate claim against your current system clock:
{
"iss": "https://auth.example.com",
"sub": "usr_9481",
"iat": 1735689600,
"nbf": 1735689600,
"exp": 1735693200
}
iat(1735689600): Issued at2025-01-01T00:00:00Z.nbf(1735689600): Not valid before2025-01-01T00:00:00Z.exp(1735693200): Expires at2025-01-01T01:00:00Z(exact 3,600-second TTL).
3. Local HMAC-SHA256 Signature Verification
Decoding proves only that the first two segments are valid Base64URL-encoded JSON; it does not prove the claims are untampered. When you supply the shared secret your-256-bit-secret for the first example above, the verifier passes the exact ASCII signing input (eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ) and the 43-character Base64URL signature (SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c) to crypto.subtle.verify("HMAC", key, signatureBytes, signingInputBytes). Any single-bit edit to the decoded JSON payload changes the expected 32-byte MAC tag and triggers an immediate signature mismatch.