Skip to content

docs: clarify OIDC role mapping requires a mapped group#97

Merged
gantoine merged 3 commits into
mainfrom
posthog-code/oidc-role-mapping-requires-group
Jul 18, 2026
Merged

docs: clarify OIDC role mapping requires a mapped group#97
gantoine merged 3 commits into
mainfrom
posthog-code/oidc-role-mapping-requires-group

Conversation

@gantoine

Copy link
Copy Markdown
Member

What

Fixes a documentation gap surfaced in a Discord #help thread: a newly created (non-admin) OIDC user was rejected at login with {"detail":"User has not been granted any roles for this application."}.

The cause is that once OIDC_CLAIM_ROLES is set, RomM requires every user to match at least one mapped role group. Admins matched OIDC_ROLE_ADMIN, but regular users in no mapped group were turned away. The fix (per the thread) is to map non-admins to the User role via OIDC_ROLE_VIEWER/OIDC_ROLE_EDITOR.

The old docs described those vars as legacy no-ops, which hid the fact that they're still how you grant non-admins access.

Changes

  • administration/oidc/index.md — replaced the "Legacy role variables" note with a warning explaining group matching becomes mandatory, showing the exact error and the OIDC_ROLE_VIEWER=platform-users fix; clarified that skipping OIDC_CLAIM_ROLES provisions everyone as User.
  • troubleshooting/authentication.md — new OIDC entry keyed on the exact error string, with the fix.
  • resources/snippets/env-vars.md — corrected OIDC_ROLE_VIEWER/OIDC_ROLE_EDITOR descriptions.

Created with PostHog Code

gantoine and others added 3 commits July 18, 2026 08:05
Setting OIDC_CLAIM_ROLES makes group matching mandatory: non-admin users
in no mapped group are rejected with "User has not been granted any roles
for this application." Document the OIDC_ROLE_VIEWER/EDITOR fix and correct
the misleading "legacy no-op" framing.

Generated-By: PostHog Code
Task-Id: 8650f3d2-ad2c-4988-9843-4c7941b886d5
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gantoine
gantoine merged commit 22451fe into main Jul 18, 2026
4 checks passed
@gantoine
gantoine deleted the posthog-code/oidc-role-mapping-requires-group branch July 18, 2026 18:48
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