security: add support for Authorization header with Bearer authentication scheme
See original GitHub issueIn Swagger 2.0 there is no way to tell that the apiKey can be given in the Authorization
header using a given (non-Basic) authentication scheme. For example the Bearer
scheme defined in RFC 6750 that is used for OAuth2 but could be used also for non-OAuth2 authentication.
Proposal: add the API Key location authorization
in the Security Scheme Object:
{
"type": "apiKey",
"in": "authorization-header",
"authenticationScheme": "Bearer"
}
Issue Analytics
- State:
- Created 8 years ago
- Reactions:64
- Comments:43 (13 by maintainers)
Top Results From Across the Web
Bearer Authentication - Swagger
Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens.
Read more >What is Bearer token and How it works? - DevOpsSchool.com
This is a single string which acts as the authentication of the API request, sent in an HTTP “Authorization” header. The string is...
Read more >How do I send a request with Authorization Bearer Header?
For security reasons, Bearer Tokens are only sent over HTTPS (SSL). Click Send to execute the Bearer Token Authorization Header example ...
Read more >Authorization - HTTP - MDN Web Docs - Mozilla
This header indicates what authentication schemes can be used to access the resource (and any additional information needed by the client to use ......
Read more >Authorize with a specific scheme in ASP.NET Core
Only one JWT bearer authentication is registered with the default authentication scheme JwtBearerDefaults.AuthenticationScheme . Additional ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, of course, the security scheme of Swagger 2.0 is insufficient.
The
apiKey
scheme within
set toheader
is designed for a custom header where the api key will be the whole value of the header. For example:will send this:
I need this:
As a temporary solution that seems to work, at least to me, is to add "Bearer " prefix manually in the auth dialog of Swagger UI.