-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
WWW-Authenticate header not present when Kong and plugins return HTTP status 401 #7772
Comments
Thank you for reporting this, I consider it a bug, we will add it to our internal tracking system |
Internal tracking: KAG-1063 |
Dear contributor, |
Summary
$ kong version
) - 2.4.1According to the HTTP specification for 401 error, https://httpwg.org/specs/rfc7235.html#status.401, WWW-Authenticate header field containing at least one challenge applicable to the target resource must be returned in the response.
At least the following plugins were observed to not returning the header when returning 401.
For Oauth2 related plugins oauth2 and jwt, below are additional requirements from the related RFCs. They further define what needs to be included in the WWW-Authenticate header.
Steps To Reproduce
Exercise any unit tests of those plugins that would return 401 error and add an assertion in those test to detect the header, the assertion would fail.
For example in jwt pluging 03_acces_spec.lua, add the LAST assertion and execute the test, it will fail.
The text was updated successfully, but these errors were encountered: