[GH-ISSUE #1883] Add role to userinfo endpoint for oidcProvider plugin #26283

Closed
opened 2026-04-17 16:46:52 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @ArnonErez on GitHub (Mar 19, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1883

Is this suited for github?

  • Yes, this is suited for github

I want to use better-auth as an OIDC provider for some service(s).
I want to be able to pass the user's role (and possibly any custom attribute) with the userinfo endpoint.

Example usage:
Sync user role with Grafana using the generic-oauth config.

I believe that's possible with many similar OAuth2 solutions.

Describe the solution you'd like

Potential solutions:

  • adding role to the profile claim by default if it exists (admin plugin included).
  • adding role(s) as a scope

Describe alternatives you've considered

Currently none. I'm open to suggestions.
If it's possible to achieve using hooks then I'd really appreciate some guidance on how to do that.

Additional context

No response

Originally created by @ArnonErez on GitHub (Mar 19, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1883 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. I want to use better-auth as an OIDC provider for some service(s). I want to be able to pass the user's role (and possibly any custom attribute) with the userinfo endpoint. Example usage: Sync user role with Grafana using the [generic-oauth config](https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/generic-oauth/#configure-role-mapping). I believe that's possible with many similar OAuth2 solutions. ### Describe the solution you'd like Potential solutions: - adding role to the profile claim by default if it exists (admin plugin included). - adding role(s) as a scope ### Describe alternatives you've considered Currently none. I'm open to suggestions. If it's possible to achieve using hooks then I'd really appreciate some guidance on how to do that. ### Additional context _No response_
GiteaMirror added the locked label 2026-04-17 16:46:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#26283