JSON Web Token
A JSON Web Token is a compact, URL-safe format for representing claims as a JSON object that can be digitally signed, integrity-protected, or encrypted.
Secure APIs
A JSON Web Token is a compact, URL-safe token format for representing claims that can be digitally signed or encrypted.
- How it is used
- Authorizes API requests by carrying signed claims about a user or nonhuman subject’s rights, scopes, role, or identity.
- How deep it goes
- Explains structure, token distinctions, issuance choices, validation failures, and testing implications without detailing complete validation code.
- Examples
- Uses Python PyJWT payloads, HS256 and PS256 issuance, unsigned or expired tokens, and token-tampering security tests.
- What you can do after
- Evaluate JWT designs, issue tokens with PyJWT, and test validation failures such as tampering, algorithm confusion, expiry, and privilege escalation.
ASP.NET Core in Action, 3e
A JSON Web Token, or JWT, is a compact, signed token format for representing claims between parties.
- How it is used
- Uses JWTs as bearer tokens to authenticate API requests and support endpoint authorization.
- How deep it goes
- Explains token structure and validation, then walks through ASP.NET Core configuration and local token creation and management.
- Examples
- Uses a protected recipe endpoint and locally generated tokens with customizable claims and scopes.
- What you can do after
- Apply JWT bearer authentication via ASP.NET Core and generate tokens with dotnet user-jwts for local API testing.
Read how ASP.NET Core in Action, 3e explains JSON Web Token →
Spring Security in Action, Second Edition
A JSON Web Token is a compact token format that represents claims as a digitally signed or otherwise protected JSON-based value.
- How it is used
- Carries authorization claims from an OAuth 2 authorization server to a resource server for authentication and access control.
- How deep it goes
- Explains the three-part structure, visibility, signature validation, Spring configuration, key retrieval, and endpoint testing.
- Examples
- Uses a three-part token sample, Spring configuration, a /demo endpoint, public-key metadata, and a Bearer-token curl request.
- What you can do after
- Build it from scratch by configuring Spring Security to validate JWTs against an authorization server’s public key set.
Read how Spring Security in Action, Second Edition explains JSON Web Token →
Effective Platform Engineering
A JSON Web Token is a compact, signed token format for conveying claims between parties.
- How it is used
- Carries identity and team-membership claims from an IDP to support access to platform resources.
- How deep it goes
- Works through claim sourcing and a device-authorization flow, but does not detail JWT format or verification internals.
- Examples
- Uses a GitHub-authenticated CLI flow and an Auth0 configuration exercise that adds GitHub teams to a verifiable JWT.
- What you can do after
- Apply it via GitHub and Auth0 to produce a verifiable JWT containing a user’s team membership after authentication.
Read how Effective Platform Engineering explains JSON Web Token →
.NET in Action, Second Edition
A JSON Web Token is a compact, URL-safe token format for conveying claims between parties, commonly with a digitally signed or authenticated representation.
- How it is used
- Uses JWT bearer tokens to authenticate web API requests before authorization policies decide endpoint access.
- How deep it goes
- Explains token parts and selected claims, then configures bearer authentication and claim-based authorization; leaves OpenID Connect history aside.
- Examples
- Inspects a Swagger UI request’s bearer token and uses ASP.NET Core listings for middleware, action policies, and a claim-checking handler.
- What you can do after
- Apply it via ASP.NET Core JWT bearer authentication and authorization policies, and inspect token claims without casually exposing a live token.
Read how .NET in Action, Second Edition explains JSON Web Token →
.NET MAUI in Action
A JSON Web Token is a compact, signed token format for representing claims exchanged between parties.
- How it is used
- Authenticates calls from a .NET MAUI app to protected API resources after browser-based identity-provider sign-in.
- How deep it goes
- Explains the acquisition flow and configuration but stops short of detailing JWT claim structure or signature validation.
- Examples
- Uses MauiStockTake authentication with IdentityServer, LoginAsync, a custom redirect scheme, and platform URL-registration files.
- What you can do after
- Operate/configure a .NET MAUI authentication service that obtains a JWT through an OIDC-compliant identity provider.
Spring Microservices in Action
JSON Web Token (JWT) is a compact, URL-safe format for representing claims that can be digitally signed, integrity protected, or encrypted.
- How it is used
- Uses signed JWTs as OAuth2 tokens passed between microservices for authentication and authorization.
- How deep it goes
- Explains issuance, validation, propagation and custom claims with Spring configuration, while deferring public/private key setup.
- Examples
- Uses licensing and organization services, a shared signing key, and an organizationId claim to demonstrate JWT handling.
- What you can do after
- Apply it via Spring Security to issue, consume, propagate and extend JWTs in microservices.
Read how Spring Microservices in Action explains JSON Web Token →
Software Security for Developers
JSON Web Token is a compact, URL-safe format for representing claims that can be transmitted between parties.
- How it is used
- Uses JSON claims and signatures to package access, identity, and authorization information across OAuth 2/OIDC interactions.
- How deep it goes
- Explains structure, claims, validation, expiration, standards relationships, and alg:none risk without developing public-key cryptography.
- Examples
- Shows a three-part token, decoded header and payload JSON, subject claims, short expiration, and an alg:none tampering scenario.
- What you can do after
- Diagnose JWT structure, verify signatures, interpret claims, and configure libraries to reject insecure algorithm choices.
Read how Software Security for Developers explains JSON Web Token →
Building Web APIs with ASP.NET Core
JSON Web Token (JWT) is a compact, claims-based token format for securely transmitting information between parties.
- How it is used
- Secures account login and prepares an ASP.NET Core API for restricting data-changing operations to authorized users.
- How deep it goes
- Explains controller wiring, credential verification, signing-key configuration, token creation, and endpoint testing without detailing token validation internals.
- Examples
- Uses RegisterDTO, LoginDTO, /Account/Register, /Account/Login, SwaggerUI, configured signing credentials, and concrete validation responses.
- What you can do after
- Build JWT-backed registration and login endpoints with ASP.NET Core Identity and verify them through SwaggerUI.
Read how Building Web APIs with ASP.NET Core explains JSON Web Token →
Spring in Action, Sixth Edition
A JWT is a compact, signed or encrypted JSON-based token format for conveying claims between parties.
- How it is used
- Secures REST API requests by carrying authenticated identity and permission scopes from a client to a resource server.
- How deep it goes
- Explains claims, scope checks, signature verification, and Spring configuration, but does not detail JWT encoding or encryption internals.
- Examples
- Demonstrates Taco Cloud ingredient creation and deletion through curl requests carrying scoped Bearer tokens.
- What you can do after
- Operate/configure a Spring resource server that validates JWTs and authorizes endpoints using OAuth 2 scopes.
Read how Spring in Action, Sixth Edition explains JSON Web Token →
Grokking Software Architecture
JWT is a compact, URL-safe token format for representing claims that can be digitally signed or encrypted.
- How it is used
- Carries an identity provider’s verified user and role claims from login to API requests.
- How deep it goes
- Traces issuance and gateway verification, then names JWKS, expiry, and algorithm checks without detailing implementation code.
- Examples
- Uses a User-role login, forged admin claims, browser API requests, and the none-algorithm failure.
- What you can do after
- Diagnose token-handling risks by checking JWKS signatures, validating exp, pinning the algorithm, and enforcing backend authorization.
Read how Grokking Software Architecture explains JSON Web Token →
Go in Practice, Second Edition
A JSON Web Token is a signed token format for transmitting claims between parties, commonly including identity information.
- How it is used
- Uses signed claims to preserve identity across HTTP and websocket interactions without relying solely on cleartext cookies or session identifiers.
- How deep it goes
- Defines claims and demonstrates Go signing with HS256, registered timestamps, and a subject, while deferring custom cryptographic implementation.
- Examples
- Demonstrates a real-time chat identity problem and a Go token containing subject, expiration, issue-time, and not-before claims.
- What you can do after
- Apply it via the golang-jwt/jwt library to generate signed identity tokens with registered claims.
Read how Go in Practice, Second Edition explains JSON Web Token →
Grokking Web Application Security
A JSON Web Token is a compact, digitally signed token format that carries claims about a subject, such as a user's profile information.
- How it is used
- Carries authenticated session state and credentials across services, including OpenID Connect profile information.
- How deep it goes
- Defines JWTs and explains signing, validation, transport, readability, and XSS risks without detailing token internals.
- Examples
- Uses Node.js token signing, a Bearer Authorization request, and a Facebook OpenID sign-on flow.
- What you can do after
- Operate/configure JWT-based sessions by signing tokens, validating them at each service, and limiting client-side exposure.
Read how Grokking Web Application Security explains JSON Web Token →
Also covered in
- Pro ASP.NET Core 7, Tenth Edition
- Building Distributed Applications that Work
- Rust Servers, Services, and Apps
- Pro Angular 16
- Quarkus in Action
What to know first
- authenticationAuthentication is the process of verifying the claimed identity of a user, service, device, or other entity.
- OAuthOAuth is an authorization framework that enables a client to obtain limited, delegated access to protected resources without receiving the resource owner's credentials.
- authorizationAuthorization is the determination of which actions or resources an identity or other entity is permitted to access under defined permissions or policies.
- openid connectOpenID Connect is an identity layer built on OAuth 2.0 that enables clients to authenticate end users and obtain standardized identity claims.
Related concepts
- OpenID Connect ID tokenincludes · An OpenID Connect ID token is a signed token containing claims about an authenticated end user, the authentication event, and the client for which it was issued.
- cookiealternative to · An HTTP cookie is a small piece of data stored by a client and sent with subsequent requests within its scope, often to maintain state or preferences.
- claimhas part · A claim is an assertion, allegation, or request concerning a fact, attribute, right, entitlement, or proposition that may be recognized or evaluated.
- authenticationused by · Authentication is the process of verifying the claimed identity of a user, service, device, or other entity.
- HTTP Authorization headeruses · The HTTP Authorization header is a request header field that carries credentials or other authentication or authorization information for accessing a resource.
- JWT headerhas part · A JWT header is the JSON-encoded metadata section of a JSON Web Token that typically identifies its type, signing algorithm, and key.
Questions about JSON Web Token
What is JSON Web Token?
A JSON Web Token is a compact, URL-safe format for representing claims as a JSON object that can be digitally signed, integrity-protected, or encrypted.
Which Manning books explain JSON Web Token?
Secure APIs, ASP.NET Core in Action, 3e, Spring Security in Action, Second Edition, Effective Platform Engineering, .NET in Action, Second Edition, .NET MAUI in Action, Spring Microservices in Action, Software Security for Developers and 5 more.
What should I know before learning JSON Web Token?
Manning books that teach JSON Web Token usually introduce authentication, OAuth, authorization and openid connect first.
What is the difference between JSON Web Token and cookie?
A JSON Web Token is a compact, URL-safe format for representing claims as a JSON object that can be digitally signed, integrity-protected, or encrypted. An HTTP cookie is a small piece of data stored by a client and sent with subsequent requests within its scope, often to maintain state or preferences.
What kinds of JSON Web Token are there?
Kinds of JSON Web Token include OpenID Connect ID token.
What are the parts of JSON Web Token?
JSON Web Token includes claim and JWT header.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.












