Hello,
I’m having troubles with Grafana authentication.
My setup is as following:
- Grafana is configured to allow login with generic OAuth
- I use Keycloak for identity provider
- Keycloak is configured to allow login with other identity providers (Google, Microsoft, etc.)
The issue happens in following scenario:
- I go to Grafana login page and click sign in with OAuth (Keycloak)
- I sign in to Keycloak with a 3rd party identity provider (Google or any other)
- I get redirected back to Grafana login page with an error: “Login failed. User sync failed”.
Grafana log gets a warning: logger=authn.service t=2024-09-24T01:02:51.046510858Z level=warn msg="Failed to authenticate request" client=auth.client.session error="user token not found"
.
OAuth login works fine if I use username/password login in Keycloak, the issue happens only if I use social login. Also, same scenario (App --OIDC–> Keycloak --OIDC–> 3rd-Party-IdP) works fine for other apps (Graylog, Portainer), so the issue is specific to Grafana.
Any tips on how to debug the issue would be greatly appreciated.
Thanks.