You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extend group extraction with dual-claim and dot-notation support (#4911)
A single Cedar authorizer must handle the group/role claim layouts of
all major IDPs: Entra ID puts roles in "roles" and groups in "groups"
(dual-claim), Okta uses "groups" or a URI-style claim, and Keycloak
nests roles under "realm_access.roles". The previous single-claim
extractGroupsFromClaims could not express any of these.
Replace extractGroupsFromClaims with resolveNestedClaim + extractGroups
+ dedup. Groups are now extracted from both GroupClaimName and
RoleClaimName, merged, and deduplicated before Cedar evaluation.
resolveNestedClaim tries exact top-level match first (Auth0/Okta
URL-style claim names containing dots) then dot-notation traversal
(Keycloak-style nested claims).
The well-known fallback ("groups", "roles", "cognito:groups") is
preserved: when the configured GroupClaimName is absent from the token
or unconfigured, the well-known names are still checked. This matches
the documented contract that the custom name takes priority over
defaults, not replaces them.
E2E tested in a Kind cluster with real IDP tokens:
Entra MCPServer (RoleClaimName: "roles"):
JWT: { "roles": ["mcp-admin", "developer"] }
permit(principal in THVGroup::"mcp-admin", action, resource
in MCP::"<server>");
call_tool "echo" -> 200 (role extracted, THVGroup parent set)
Okta MCPServer (GroupClaimName: "groups"):
JWT: { "groups": ["Everyone", "engineering"] }
permit(principal in THVGroup::"engineering", action, resource
in MCP::"<server>");
call_tool "echo" -> 200
Wrong-group denial (same Okta OIDC, different policy):
permit(principal in THVGroup::"platform-ops", ...);
user in "engineering" only -> 403
Dot-notation traversal (Keycloak) is unit-tested; no Keycloak
server was deployed for E2E.
Fixes#4768
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments