Ready to post? First try searching for your answer. * What happened?
- We are having trouble logging in with Grafana using Generic Oauth. In Grafana’s previous version 10.2.2, we had no problems logging in with Auth0. Following the most recent Grafana upgrade, additional modifications were made to the Generic Oauth integration. When we specified the allowed_organization option in Grafana, the user associated with Auth0 Organisation was able to log in, and non-users of Auth0 Organisation were unable to do so. This allowed us to manage external clients. And now that multiple options have changed, the allowed_organization option isn’t working. Organisation mapping and Organisation attribute path are new options that have been added, and I couldn’t find any documentation explaining how to set them up.
- What did you expect to happen?
- Grafana has included additional options such as Organisation mapping and Organisation attribute path, which require users to be part of Auth0. Organisations should utilise the Generic Oauth approach to log in to Grafana. Since our goal is to allow AuthO Org user members to log in on Grafana, all users can log in even though I added the org_mapping as org_id and org_name and the org attribute path as AuthO Org name:Grafana Org Id: Role. This shouldn’t be the case, though, as the remaining users should either not be able to log in or should be under the Main Org.
- Can you copy/paste the configuration(s) that you are having problems with?
- [auth.generic_oauth]
allow_sign_up = true
api_url = https:/ourdomain.auth0.com/userinfo
auth_url = sameurl/authorize
enabled = true
name = Auth0
scopes = openid email profile
skip_org_role_sync = true
token_url = sameurl/authorize/oauth/token
use_pkce = true
use_refresh_token = true
org_mapping = [“smart-dev:16:Viewer”]
org_attribute_path = [“org_name”]
role_attribute_path = “Viewer”
- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactlywhat they were.
- {“level”:“error”,“logger”:“orgrole.mapper”,“mapping”:“[“smart-dev:16:Viewer”]”,“msg”:“Skipping org mapping due to invalid format.”,“t”:“2025-05-09T12:38:45.”}
- 2025-04-18T00:00:24.067+02:00{“error”:“unsuccessful response status code 404: Not found.”,“level”:“error”,“logger”:“oauth.generic_oauth”,“msg”:“Error getting organizations”,“t”:“2025-04-17T22:00:24.”,“url”:“https://ourauthodomain.com/userinfo/orgs”}