Security scheme
An OpenAPI security scheme is a declaration describing the authentication or authorization mechanism, credentials, and scopes used to protect API operations.
ASP.NET Core in Action, 3e
An OpenAPI security scheme is a declaration describing the authentication or authorization mechanism an HTTP API uses to protect operations.
- How it is used
- Connects API authentication requirements to OpenAPI documentation and Swagger UI testing.
- How deep it goes
- Defines schemes and requirements with Swashbuckle, but stops short of implementing authentication or authorization itself.
- Examples
- Uses an OpenApiSecurityScheme, AddSecurityDefinition(), AddSecurityRequirement(), and Swagger UI's Bearer token authorization dialog.
- What you can do after
- Configure it via Swashbuckle so Swagger UI sends bearer tokens in Authorization headers when testing protected API operations.
Read how ASP.NET Core in Action, 3e explains security scheme →
Secure APIs
A security scheme is an OpenAPI configuration object that describes how an API request is authenticated and authorized, including credential type, placement, and scopes.
- How it is used
- Documents API authentication and authorization decisions in OpenAPI specifications.
- How deep it goes
- Explains scheme fields and application scope, then connects JWT schemes to validation without detailing every authentication flow.
- Examples
- Uses a JWT bearer definition and a globally protected API with a public operation override.
- What you can do after
- Configure OpenAPI security schemes globally or per operation and recognize essential JWT validation checks.
The Design of Web APIs, Second Edition
A security scheme is an API security mechanism definition that specifies how a consumer authenticates or authorizes access.
- How it is used
- Defines authentication and authorization requirements for API operations, webhooks, and consumer access.
- How deep it goes
- Explains scheme placement, flows, scopes, operation application, webhook use, reuse limits, and migration risks.
- Examples
- Uses beneficiary scopes, mutual TLS webhooks, API-key migration, and reusable OpenAPI component libraries.
- What you can do after
- Build it from scratch by defining schemes and scopes, applying them to operations, and planning safer security migrations.
Read how The Design of Web APIs, Second Edition explains security scheme →
Related concepts
- OpenAPI specificationused by · The OpenAPI Specification is a standard, machine-readable format for describing HTTP APIs, including their operations, inputs, outputs, data structures, and security requirements.
- AddSecurityDefinitionimplemented by · AddSecurityDefinition is a Swashbuckle configuration method that registers a security scheme in an OpenAPI document.
- breaking changeproduces · A breaking change is a modification to an interface, behavior, format, configuration, or contract that can prevent existing consumers from working correctly without changes.
- scopehas part · Scope is a defined boundary specifying which entities, activities, resources, or conditions are included or governed in a particular context.
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.


