feat(sso): show full IdP claims in /sso/debug/callback - #27498
Conversation
The debug callback only displayed the proxy-parsed OpenID summary, so customers couldn't verify what custom claims (team_id, team_alias, roles, etc.) the IdP was actually returning. Render two new sections — Raw Claims (userinfo) and Access Token Claims (decoded JWT) — alongside the existing parsed view. Strip bearer tokens defense-in-depth in case a non-conforming IdP places them in its userinfo response. Resolves LIT-2838
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Greptile SummaryThis PR extends
Confidence Score: 5/5Safe to merge — the debug endpoint only surfaces additional IdP claims that were already available server-side, token fields are stripped at two layers, and the template injection is escaped correctly against script-injection. The change is well-scoped to the debug SSO endpoint, which is admin-only. The XSS concern raised in the prior review (unescaped No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/proxy/management_endpoints/ui_sso.py | Captures received_response and access_token_payload from the generic SSO path, strips _OAUTH_TOKEN_FIELDS (defense-in-depth), and injects all three sections into the structured sso_payload; XSS mitigation via replace('</', '\/') is correctly applied before embedding the JSON into the script block. |
| litellm/proxy/common_utils/html_forms/jwt_display_template.py | Adds "Raw Claims (userinfo)" and "Access Token Claims" sections alongside the renamed "Parsed by Proxy" section; JavaScript renders all values via textContent (safe from DOM-based XSS); layout and CSS additions are cosmetically clean. |
| tests/test_litellm/proxy/management_endpoints/test_ui_sso.py | Two new mock-only async tests cover the generic SSO path (full claims + token stripping) and the Microsoft/Google path (empty sections); no real network calls, consistent with repo testing standards. |
Reviews (2): Last reviewed commit: "Update litellm/proxy/management_endpoint..." | Re-trigger Greptile
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
@greptile re review |
* feat(sso): show full IdP claims in /sso/debug/callback The debug callback only displayed the proxy-parsed OpenID summary, so customers couldn't verify what custom claims (team_id, team_alias, roles, etc.) the IdP was actually returning. Render two new sections — Raw Claims (userinfo) and Access Token Claims (decoded JWT) — alongside the existing parsed view. Strip bearer tokens defense-in-depth in case a non-conforming IdP places them in its userinfo response. Resolves LIT-2838 * Update litellm/proxy/management_endpoints/ui_sso.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix(sso): hoist json.dumps out of f-string for py3.10 ruff --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Summary
/sso/debug/callbackonly showed the proxy-parsed OpenID summary (id,email,display_name,team_ids,user_role). Customers using custom JWT claim mappings (team_id_jwt_field,team_alias_jwt_field, etc.) had no way to confirm what their IdP was actually returning — the very fields they configured were invisible in the debug page.This PR renders two additional sections on the callback HTML:
Plus the existing OpenID summary, now labeled Parsed by Proxy.
Screenshots
before

after
Test plan
make test-unitfor the SSO test module passes locally.test_debug_sso_callback_renders_full_jwt_claims— asserts custom claims (team_id,team_alias,teams,roles) reach the rendered HTML, and a plantedaccess_token/id_tokenin userinfo is stripped from the response body.test_debug_sso_callback_handles_missing_raw_response— asserts Microsoft / Google paths (which don't return raw responses or access-token payloads today) still render successfully with empty raw-claims and access-token-claims sections./sso/debug/login-> Auth0 ->/sso/debug/callbackagainst an Auth0 tenant with a Post-Login Action emitting custom claims; verified before/after rendering and bearer-token strip on a real flow.Resolves LIT-2838