HTTPBearer security scheme is returning 403 instead or 401
See original GitHub issueHTTPBearer security scheme enabled as a dependency is returning a 403
when a request is unauthenticated because of a missing or a malformed authorization
header. In those scenarios, a 401
should be returned instead.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Forbidden (403), Unauthorized (401), or What Else? - Auth0
403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on...
Read more >Spring Security Returns with 403 when there is no Bearer token
But when tested with different scenario it is found that spring security returns with 403 instead of 401 if there is no Authorization...
Read more >HTTP Basic Auth - FastAPI
If it doesn't receive it, it returns an HTTP 401 "Unauthorized" error. ... Create a " security scheme" using HTTPBasic . Use that...
Read more >HTTP authentication - MDN Web Docs - Mozilla
The server responds to a client with a 401 (Unauthorized) response status ... The "Basic" authentication scheme offers very poor security, ...
Read more >TDD Approach to Create an Authentication System With ...
It returns a status code of 403 in return. This happens because we don't have the Bearer token in the Authorization header. If...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
It makes total sense to have 401 returned, I’m sure tiangolo did not mean 403 and it was just a small mishap
This is still not fixed