From 485da8a20862d73ac6dc2b9f6a402156fa820b19 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Fri, 6 Mar 2026 11:12:39 -0800 Subject: [PATCH] address greptile review feedback (greploop iteration 35) --- litellm/proxy/management_endpoints/ui_sso.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/management_endpoints/ui_sso.py b/litellm/proxy/management_endpoints/ui_sso.py index 8762ab8967d..1c3c9c12619 100644 --- a/litellm/proxy/management_endpoints/ui_sso.py +++ b/litellm/proxy/management_endpoints/ui_sso.py @@ -2976,10 +2976,23 @@ class SSOAuthenticationHandler: ) if userinfo is None: + id_token_attempted = isinstance(id_token, str) and bool(id_token) if userinfo_endpoint: - detail = "userinfo endpoint failed and no id_token was present in the token response" + if id_token_attempted: + detail = ( + "userinfo endpoint failed and id_token was present but " + "decoded to an empty payload — no identity claims available" + ) + else: + detail = "userinfo endpoint failed and no id_token was present in the token response" else: - detail = "no userinfo endpoint is configured (GENERIC_USERINFO_ENDPOINT) and no id_token was present" + if id_token_attempted: + detail = ( + "no userinfo endpoint is configured (GENERIC_USERINFO_ENDPOINT) " + "and id_token decoded to an empty payload — no identity claims available" + ) + else: + detail = "no userinfo endpoint is configured (GENERIC_USERINFO_ENDPOINT) and no id_token was present" raise ProxyException( message=f"SSO user info unavailable: {detail}.", type=ProxyErrorTypes.auth_error,