Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HTTPBearer to return 401 on error #10232

Conversation

ordinary-jamie
Copy link

@ordinary-jamie ordinary-jamie commented Sep 12, 2023

馃幆 Aim

Closes #10177

馃搵Notes

RFC 6750 section 3.1 suggests that for cases where the "...access token provided is expired, revoked, malformed, or invalid for other reasons. The resource SHOULD respond with the HTTP 401 (Unauthorized) status code."

This commit updates the HTTPBearer scheme to reflect this.

HTTPBearer scheme should return a 401 in the case of missing or
malformed authorization header, consistent with RFC 6750 Section 3.1
@Kludex
Copy link
Sponsor Collaborator

Kludex commented Sep 12, 2023

@ordinary-jamie
Copy link
Author

Ah woops, sorry didn't properly check first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTPBearer security scheme is returning 403 instead or 401
2 participants