Skip to content

feat(oauth): group names + ids in claims, accept offline_access#65

Merged
BK1031 merged 1 commit into
mainfrom
bk1031/feat-oidc-group-names-offline-access
Jun 2, 2026
Merged

feat(oauth): group names + ids in claims, accept offline_access#65
BK1031 merged 1 commit into
mainfrom
bk1031/feat-oidc-group-names-offline-access

Conversation

@BK1031
Copy link
Copy Markdown
Contributor

@BK1031 BK1031 commented Jun 2, 2026

Two OIDC improvements ahead of the ArgoCD SSO integration.

Group claims: names + ids

  • groups now contains group names (what RBAC policies key on — e.g. ArgoCD g, DevOps, role:admin)
  • group_ids is a new claim with the stable ULIDs, for consumers that need rename-safe references
  • Applied consistently to the access token, ID token, and UserInfo via a shared SetGroupClaims; per-client filtering and the groups:read/sentinel:all gate are unchanged

offline_access

  • Added offline_access as an accepted scope so OIDC clients (ArgoCD) can request a refresh token without ValidateScopes rejecting the whole request
  • Behavior is unchanged: Sentinel already issues a refresh token on every grant. We deliberately did not gate refresh issuance on offline_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 groups claim previously held group IDs and now holds names. Any client reading IDs from groups should switch to group_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.

- 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.
@BK1031 BK1031 merged commit 8c7af9e into main Jun 2, 2026
11 checks passed
@BK1031 BK1031 deleted the bk1031/feat-oidc-group-names-offline-access branch June 2, 2026 21:46
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.

1 participant