Fix Grafana Tailscale login role mapping #224

Merged
alex merged 1 commit from wiring-guru/grafana-oidc-role-refs into main 2026-11-11 11:38:21 -07:00 AGit
Contributor

Grafana's ini loader unescapes role_attribute_path = 'Viewer' to Viewer, which JMESPath reads as a field lookup on tsidp's token; role_attribute_strict then rejects the login. Double-quote the literal so Grafana hands JMESPath the 'Viewer' literal.

Grafana's ini loader unescapes role_attribute_path = 'Viewer' to Viewer, which JMESPath reads as a field lookup on tsidp's token; role_attribute_strict then rejects the login. Double-quote the literal so Grafana hands JMESPath the 'Viewer' literal.
Keep the static Viewer role intact through Grafana's ini parsing
All checks were successful
Apply Argo CD Applications / update-repo-folder (push) Successful in 1s
Apply Argo CD Applications / update-repo (push) Successful in 0s
Apply Argo CD Applications / apply-applications (push) Successful in 2s
69c62220e0
Grafana's config loader unescapes a quoted ini value, so role_attribute_path = 'Viewer'
reached the OAuth provider as bare Viewer: a JMESPath field lookup on tsidp's ID token,
which carries no such claim. The lookup returned nothing, and role_attribute_strict turned
that into a failed login ("IdP did not return a role attribute"). Double-quoting the
literal makes the loader strip the outer quotes and hand JMESPath the 'Viewer' literal.

Verified against grafana 13.1.1 (the version chart 12.8.0 deploys): /api/admin/settings
reports role_attribute_path = 'Viewer' and JMESPath resolves it to the Viewer role.
alex merged commit 69c62220e0 into main 2026-11-11 11:38:21 -07:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alex/infrastructure!224
No description provided.