-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Open
Labels
area/oauthenhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.
Description
Description:
There are a lot scenarios where OAuth2 Filter returns 401 status code. But in AccessLog there is no further detail why it was a 401. That makes troubleshooting hard. You have to switch to debug logging if you want more insights.
Example:
"response_code":"401","response_flags":"-","response_code_details":""
We should enrich it with a short explainer:
envoy/source/extensions/filters/http/oauth2/filter.cc
Lines 859 to 863 in 2425431
void OAuth2Filter::sendUnauthorizedResponse() { | |
config_->stats().oauth_failure_.inc(); | |
decoder_callbacks_->sendLocalReply(Http::Code::Unauthorized, UnauthorizedBodyMessage, nullptr, | |
absl::nullopt, EMPTY_STRING); |
Like this:
decoder_callbacks_->encodeHeaders(std::move(response_headers), true, REDIRECT_LOGGED_IN); |
results in "response_code":"302","response_flags":"-","response_code_details":"oauth.logged_in"
cc: @zhaohuabing
zhaohuabing
Metadata
Metadata
Assignees
Labels
area/oauthenhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.