JSON Web Token
A JSON Web Token (JWT, pronounced 'jot') is a compact, self-contained token used to securely transmit information between two parties, typically a client and a server. It encodes claims as JSON and is formatted to be safe for use in URLs. JWTs are commonly used in web applications and APIs to handle authentication and authorization.
JSON Web Token (JWT) is an open standard defined in RFC 7519 that specifies a compact, URL-safe method for representing claims to be transferred between two parties. The claims are encoded as a JSON object and may be digitally signed (using JWS) or encrypted (using JWE), enabling integrity verification and, optionally, confidentiality. The token structure supports self-contained transmission of identity and authorization context without requiring server-side session state.
Why it matters
JWTs are central to how modern web applications and APIs handle authentication and authorization. Because the token is self-contained, servers can verify a user's identity and permissions without querying a central session store, making JWTs well-suited for stateless and distributed architectures. This design has made them a dominant mechanism in single-page applications, mobile backends, and microservices.
However, the self-contained nature of JWTs also means that implementation mistakes carry significant security consequences. A forged or tampered token can grant unauthorized access to any resource that trusts it, because the token itself carries the authorization context. Vulnerabilities such as the 'alg:none' attack, where an attacker strips the signature algorithm from the header to bypass verification, and algorithm confusion attacks that exploit libraries accepting both symmetric and asymmetric key types, have been demonstrated repeatedly in real-world systems. These classes of issue arise not from the standard itself but from insecure library implementations and developer misconfiguration.
Revocation also presents a structural challenge. Unlike server-side sessions, a signed JWT remains valid until its expiration time unless the application implements additional controls such as a token blocklist or short expiry windows. This means that a compromised token cannot be easily invalidated in real time, which has operational implications for incident response and account takeover scenarios.
Who it's relevant to
Inside JWT
Common questions
Answers to the questions practitioners most commonly ask about JWT.