Zero-Server Architecture: Why Local Browser Processing Protects Sensitive Documents
An architectural deep dive into why client-side execution eliminates the server-side attack surface and guarantees complete data sovereignty.
An engineering deep-dive into stateless authentication, token expiration claims, preventing the "alg: none" attack, and choosing between symmetric and asymmetric signing.
Privacy & Security technical reference asset
JSON Web Tokens (JWT, pronounced "jot") are the industry-standard compact, URL-safe means of representing claims to be transferred between two parties. Defined in RFC 7519, JWTs underpin modern single-sign-on (SSO), microservice authorization, OAuth 2.0, and OpenID Connect workflows.
Because JWTs are self-contained and cryptographically signed, authentication servers can verify user identity and role permissions statelessly without querying a central session database on every single incoming HTTP request.
In traditional stateful session authentication, servers generate a random session ID, store it in Redis or a relational database, and transmit it via a cookie. As distributed applications scale to dozens of microservices, checking the session store on every API call becomes an expensive infrastructure bottleneck.
JWTs solve this by embedding the user’s identity (e.g. user ID, email, role permissions) directly inside the token payload itself. The server cryptographically validates the token’s signature using its secret or public key without making any external database queries.
A JWT is represented as three distinct Base64URL-encoded strings concatenated by period (`.`) delimiters:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTYiLCJ1c2VyIjoiQWFrYXNoIiwiYWRtaW4iOnRydWUsImV4cCI6MTc4Nzc4NjgwMH0.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
1. Header (Red): Algorithm & token type metadata
2. Payload (Purple): Subject claims, roles, and expiration timestamp
3. Signature (Blue): Cryptographic hash verifying header + payload integrityJWT signatures are generated using either symmetric or asymmetric cryptographic algorithms:
RFC 7519 defines standard reserved claim keys that every production token should implement:
| Claim | Name | Description | Example |
|---|---|---|---|
| iss | Issuer | Identifies the principal that issued the JWT. | "https://auth.example.com" |
| sub | Subject | Identifies the principal subject of the token (User ID). | "usr_98a72b" |
| aud | Audience | Identifies the recipients that the JWT is intended for. | "api.example.com" |
| exp | Expiration Time | Unix timestamp after which the token must not be accepted. | 1787786800 |
| iat | Issued At | Unix timestamp when the token was generated. | 1787783200 |
Flawed JWT library implementations have led to severe historic security exploits:
Storing authentication JWTs in browser `localStorage` leaves tokens vulnerable to Cross-Site Scripting (XSS) attacks. If malicious JavaScript executes on your page, it can read `localStorage.getItem("token")` and exfiltrate credentials.
For web applications, store access and refresh tokens in `HttpOnly`, `Secure`, `SameSite=Strict` cookies, preventing JavaScript code from accessing the token directly.
Implementing JWT authentication correctly balances high-scale stateless architecture with robust cryptographic protection.
Decode, inspect, and verify JWT headers and claims safely in browser memory with Softnag’s client-side JWT Debugger.
Try these free in-browser utilities mentioned in this guide
An architectural deep dive into why client-side execution eliminates the server-side attack surface and guarantees complete data sovereignty.
Explore native W3C crypto standards, SubtleCrypto interfaces, constant-time operations, and why pure JavaScript crypto libraries are obsolete.
Compare synchronous 5MB key-value stores with asynchronous structured IndexedDB, origin quotas, serialization overhead, and client-side data safety.