-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Fix OIDC response code when authorization header is missing #5332
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Using a 401 instead of 403 aligns with the HTTP standard when authentication is missing and with the existing OAuth2 dependency.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is still relevant to current version of FastAPI (0.110.0).
It was said in this comment to the similar issue, that it should be fixed, but we have to make sure that new solution follows the specification.
OIDC follows the OAuth2 specification here. And in the current implementation of OAuth2AuthorizationCodeBearer and OAuth2PasswordBearer status_code and headers are exactly the same.
|
Thanks for the suggestion @YuriiMotov |
|
Hello! Any idea when this will get merged? |
|
This seems still an issue in mainline as of today... cc @YuriiMotov |
The OIDC dependency currently returns a 403 response if an
Authorizationheader is missing.Using a 401 instead of 403 aligns with the HTTP standard when authentication is missing and with the existing OAuth2 dependency.