JSON Web Token
A compact signed token made of three base64url parts separated by dots: a header, a payload of claims and a signature.
Trusting an unverified token lets anyone forge an identity.
In more detail
JWT stands for JSON Web Token. Anyone can decode the header and payload, so decoding proves nothing: a service must verify the signature with an allowed algorithm and a trusted key, then check expiry, issuer, audience and required claims before trusting anything in it.
Examples
In the APIs course: The course fault 08-unverified-jwt trusts the payload without checking the signature and accepts a forged token.The course's workload identity tokens are usually of this kind.Related terms
- claim — One statement inside a token, as a name and value, such as sub (subject), exp (expiry), iss (issuer), aud (audience) or scope.
- digital signature — A value computed from data and a secret key that lets anyone with the matching verification key confirm the data came from the key holder and was not changed.
- algorithm allow list — The fixed set of signing algorithms a verifier accepts, chosen by server policy rather than by the alg field of the token.
- key identifier — A short name in a token header, kid, that says which of the verifier’s trusted keys was used to sign it.
- bearer token — A token that grants access to whoever presents it, sent as Authorization: Bearer <token>, without any further proof of identity.
- Base64 — A way to write any bytes using only 64 safe text characters, so binary data can travel in places that expect text.
- OpenID Connect — An identity layer on top of OAuth 2.0 that tells an application who signed in, using a signed ID token.
- signing key — The secret key used to sign tokens or messages, together with the key used to verify them, which may be the same secret or the public half of a pair.
- issuer — The party that created and signed a token, named in its iss claim.
- audience — The recipient a token is meant for, named in its aud claim, such as one particular API.
- refresh token — A longer-lived credential a client uses to get a new short-lived access token without asking the user to log in again.
- JSON Web Key Set — A standard JSON document that publishes a set of public keys, each with a key identifier, so clients can verify tokens.
- authentication — Establishing who a request represents, for example by checking a password, a session cookie or a signed token.
- API key — A secret string that identifies and authorises a program calling an API, usually sent in a header.
Taught in
- JSON Web Tokens — Modern API Architecture: REST, GraphQL & gRPC
- Scopes And Key Rotation — Modern API Architecture: REST, GraphQL & gRPC
- Serverless And Container Patterns: Where The Limits Bite — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- Keyless Authentication: OIDC to the Cloud — Continuous Integration & Continuous Delivery Pipelines
- Zero-Trust Network Access & IdP Federation — Cloud Security & DevSecOps Engineering
- Authentication: JWTs and Claims — Modern .NET Core, C# & Enterprise Microservices
- Session Architecture: HTTP-Only Cookies vs Tokens — Production Full-Stack Engineering
- JWT Verification: Asymmetric Keys & Refresh Rotation — Production Full-Stack Engineering
- Structured Logging & Correlation IDs: Context Stitching — Production Full-Stack Engineering
- Impersonation, Short-Lived Credentials And Workload Identity — Google Cloud Associate Cloud Engineer Exam Prep
- Authentication Versus Authorisation — Application Security & Threat Modeling for Engineers
- Workload Identity — Application Security & Threat Modeling for Engineers
- The in Operator And Instanceof Narrowing — Production TypeScript
References
- RFC 7519: JSON Web Token (JWT)
- RFC 8725: JSON Web Token Best Current Practices
- OWASP Cheat Sheet Series: JSON Web Token
- RFC 7519: JSON Web Token
- RFC 7519: JSON Web Token
- Configure JWT bearer authentication in ASP.NET Core
- JWT.io: Introduction to JSON Web Tokens