Skip to content

Conversation

@skion
Copy link

@skion skion commented Sep 1, 2022

The OIDC dependency currently returns a 403 response if an Authorization header is missing.

Using a 401 instead of 403 aligns with the HTTP standard when authentication is missing and with the existing OAuth2 dependency.

@codecov

This comment was marked as outdated.

@skion skion marked this pull request as ready for review September 1, 2022 09:32
@github-actions

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.
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions
Copy link
Contributor

Copy link
Member

@YuriiMotov YuriiMotov left a 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.

@skion
Copy link
Author

skion commented Mar 3, 2024

Thanks for the suggestion @YuriiMotov

@Bladieblah
Copy link

Hello! Any idea when this will get merged?

@skion skion requested a review from YuriiMotov October 16, 2024 09:14
@skion
Copy link
Author

skion commented Oct 16, 2024

This seems still an issue in mainline as of today... cc @YuriiMotov

@svlandeg
Copy link
Member

Thanks for the contribution @skion 🙏. I'm closing this one in favour of #13786, which is more extensive and should (hopefully) address this issue once and for all.

@svlandeg svlandeg closed this Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working p3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants