Skip to content

Conversation

zhaohuabing
Copy link
Member

@zhaohuabing zhaohuabing commented Aug 15, 2025

Commit Message: add error details to the OAuth2 filter 401 local response.
Additional Description:
Risk Level: low
Testing: unit test
Docs Changes: no
Release Notes: yes
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #37933]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

The following example shows the response_code_details added by this PR:

response_code_details":"Failed_to_get_access_token,_response_code:_400,_response_body:_{"error":"invalid_client"}

{"start_time":"2025-08-15T10:17:29.682Z","method":"GET","x-envoy-origin-path":"/myapp/oauth2/callback?code=22ef226d-ff19-417e-ab6b-cf4bce2824e0&state=eyJ1cmwiOiJodHRwczovL3d3dy5leGFtcGxlLmNvbS9teWFwcCIsImNzcmZfdG9rZW4iOiJiNmY2MWZkZWUwNjliZmI1LjdiRVdwY3JsWld3M1RIYjVMOGEyM3JyMndBRHBSRTIyZWEzeDU1RDJHWTg9In0","protocol":"HTTP/2","response_code":"401","response_flags":"-","response_code_details":"Failed_to_get_access_token,_response_code:_400,_response_body:_{"error":"invalid_client"}","connection_termination_details":"-","upstream_transport_failure_reason":"-","bytes_received":"0","bytes_sent":"18","duration":"452","x-envoy-upstream-service-time":"-","x-forwarded-for":"10.244.0.13","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36","x-request-id":"c080a8b9-3fd2-4a9e-b187-87a749fb1f65",":authority":"www.example.com","upstream_host":"-","upstream_cluster":"httproute/default/myapp/rule/0","upstream_local_address":"-","downstream_local_address":"127.0.0.1:10443","downstream_remote_address":"127.0.0.1:42518","requested_server_name":"-","route_name":"httproute/default/myapp/rule/0/match/0/www_example_com"}

Copy link
Member

@wbpcode wbpcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please add a change log. Thanks for the contribution.

@wbpcode wbpcode changed the title chore: add details to oauth2 filter 401 local response chore: set response code details to oauth2 filter 401 local response Aug 22, 2025
@wbpcode
Copy link
Member

wbpcode commented Aug 22, 2025

/wait

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OAuth2 Filter: Adding response_code_details for 401 cases
3 participants