Skip to content

Commit a0ecb87

Browse files
fix: resolve nested CustomOpenID extra_fields in CLI SSO claim extraction
When GENERIC_USER_EXTRA_ATTRIBUTES captures a parent object (e.g. org_info), extra_fields stores it as {"org_info": {"department": "..."}}. A CLI claim map entry using a dotted path like org_info.department would silently fail because the lookup only checked the exact flat key. Fall back to dotted-path resolution on extra_fields before model_dump(). Co-authored-by: Yassin Kortam <[email protected]>
1 parent 8fad6ac commit a0ecb87

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

litellm/proxy/management_endpoints/ui_sso.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,12 @@ def _extract_sso_claim_value(
325325
result: Union[CustomOpenID, OpenID, dict], claim_path: str
326326
) -> Any:
327327
extra_fields = getattr(result, "extra_fields", None)
328-
if isinstance(extra_fields, dict) and claim_path in extra_fields:
329-
return extra_fields[claim_path]
328+
if isinstance(extra_fields, dict):
329+
if claim_path in extra_fields:
330+
return extra_fields[claim_path]
331+
nested = _get_nested_claim_value(extra_fields, claim_path)
332+
if nested is not None:
333+
return nested
330334

331335
if isinstance(result, dict):
332336
return _get_nested_claim_value(result, claim_path)

0 commit comments

Comments
 (0)