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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: give correct unauthorized response on OpenID Connect Auth #9312

Closed
wants to merge 5 commits into from

Conversation

rhuanbarreto
Copy link

According to https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.2 the correct response in this case of missing value is 401.

@github-actions
Copy link
Contributor

📝 Docs preview for commit 854bba3 at: https://641ef02df7a788363926a64f--fastapi.netlify.app

@github-actions
Copy link
Contributor

📝 Docs preview for commit 379c716 at: https://641f0bfa8d28a94769db5ac3--fastapi.netlify.app

@tiangolo
Copy link
Owner

Thanks @rhuanbarreto, but with a 401:

MUST send a WWW-Authenticate header field

And as it's not clear which WWW-Authenticate header field should be used, not providing it is actually invalid, and although 403 is not the best error code, it's a valid option. So, for now, I'll leave it as is.

Later I'll do some more research to see if there's a simple way to provide the correct WWW-Authenticate values and then allow using 401.

But thanks for the interest! ☕

@tiangolo tiangolo closed this Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants