feat(oauth): group names + ids in claims, accept offline_access#65
Merged
Conversation
- Token group claims now carry both readable names and stable IDs: groups is the list of group names (what RBAC policies key on, e.g. ArgoCD), and group_ids is the list of ULIDs for rename-safe references. Applies to the access token, ID token, and UserInfo via the shared SetGroupClaims. - Add offline_access as an accepted scope so OIDC clients (e.g. ArgoCD) can request a refresh token without the request being rejected. Sentinel still always issues a refresh token; this just stops valid requests from failing. Note: the groups claim previously contained group IDs and now contains names. Consumers needing IDs should read group_ids.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two OIDC improvements ahead of the ArgoCD SSO integration.
Group claims: names + ids
groupsnow contains group names (what RBAC policies key on — e.g. ArgoCDg, DevOps, role:admin)group_idsis a new claim with the stable ULIDs, for consumers that need rename-safe referencesSetGroupClaims; per-client filtering and thegroups:read/sentinel:allgate are unchangedoffline_access
offline_accessas an accepted scope so OIDC clients (ArgoCD) can request a refresh token withoutValidateScopesrejecting the whole requestoffline_access, since that would break existing third-party clients that rely on refresh today without requesting it (and the first-party web session mints refresh via a separate path)Compat note
The
groupsclaim previously held group IDs and now holds names. Any client reading IDs fromgroupsshould switch togroup_ids. Nothing in core/oauth/discord consumes the claim internally (admin checks hit the DB; the web app reads groups from/entities/@me), so this only affects external token consumers.