Stateless JWT
with Stateful Revocation
An advanced, developer-focused demo demonstrating the exact mechanics of production-ready JSON Web Token architectures. Implements secure HttpOnly cookies, background session rotation, and a stateful revocation blacklist database.
Query the authenticated /api/auth/token-info endpoint using existing cookies to verify signature authenticity.
1. ENCODED TOKEN
Hover over the distinct color segments of this token to isolate and inspect the cryptographic chunks.
SYSTEM_LOGS
2. DECODED METADATA & CLAIMS
{
"alg": "HS256",
"typ": "JWT"
}{
"sub": "1234567890",
"email": "dev@test.com",
"iat": 1516239022
}HMACSHA256( base64UrlEncode(header) + "." + base64UrlEncode(payload), "SECRET_HMAC_KEY" ) === VERIFIED
SPECIFICATION_SPEC_SHEET
Technical implementation constraints and architecture highlights.
Prevents cross-site scripting (XSS) attacks by keeping session JWTs out of browser-accessible JavaScript namespaces. Tokens are transferred exclusively via securely-configured HTTP headers.
Silent token rotation handles background refreshes transparently. If the access token expires, a short-lived refresh token issues a brand new keypair dynamically, maintaining high security without disturbing usability.
Combines performance and security: verified sessions remain completely stateless in Next.js middleware, but explicitly revoked credentials (from logouts or lockouts) check an optimized blacklist database in real-time.