Skip to content

Normalize string-type OIDC claims to arrays#280

Merged
vikramsoni2 merged 1 commit intonxzai:mainfrom
MintBlueJelly:main
Apr 18, 2026
Merged

Normalize string-type OIDC claims to arrays#280
vikramsoni2 merged 1 commit intonxzai:mainfrom
MintBlueJelly:main

Conversation

@MintBlueJelly
Copy link
Copy Markdown

@MintBlueJelly MintBlueJelly commented Mar 13, 2026

This pull request refactors the logic for extracting user roles from OIDC claims in the deriveRolesFromClaims function to improve robustness and code readability. The main change is the introduction of a helper function to consistently handle claim values that may be arrays or single values.

Improvements to role extraction logic:

  • Added a toArray helper function to ensure that claims.groups, claims.roles, and claims.entitlements are always treated as arrays. This ensures single string-type values (as returned e.g. by JumpCloud when a user is only a member of a single group) are not discarded but preserved.

#279

@vikramsoni2 vikramsoni2 merged commit b97bc5d into nxzai:main Apr 18, 2026
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.

2 participants