Hello Team, I’m exploring integration between Grafana and Keycloak , I’m using windows 11 with docker , Grafana and keycloak are two containers , after configure , I’m getting this error, “Login failed Failed to get token from provider”
if I go to grafana logs I can see this error below
2025-03-08 19:19:00 logger=context userId=0 orgId=0 uname= t=2025-03-08T19:19:00.215989887Z level=info msg="Request Completed" method=GET path=/login/generic_oauth status=302 remote_addr=172.17.0.1 time_ms=0 duration=108.772µs size=284 referer=http://dell:3000/login handler=/login/:name
2025-03-08 19:19:00 logger=authn.service t=2025-03-08T19:19:00.289426363Z level=error msg="Failed to authenticate request" client=auth.client.generic_oauth error="[auth.oauth.token.exchange] failed to exchange code to token: Post \"http://dell:8080/realms/Grafana/protocol/openid-connect/token\": dial tcp: lookup dell on 192.168.65.7:53: no such host"
2025-03-08 19:19:00 logger=context userId=0 orgId=0 uname= t=2025-03-08T19:19:00.292606945Z level=info msg="Request Completed" method=GET path=/login/generic_oauth status=302 remote_addr=172.17.0.1 time_ms=6 duration=6.949346ms size=29 referer= handler=/login/:name
My Grafana.ini
[server]
root_url = http://dell:3000/
[auth.generic_oauth]
enabled = true
name = Keycloak # This will be the OIDC button name
allow_sign_up = true
client_id = grafana-oauth # This is your Grafana client name from Keycloak
client_secret = XXXXXXXXXXXXXX # Check the credentials section Grafana client in Keycloak
scopes = openid profile email # Ensure this matches the Keycloak client scope setting
auth_url = http://dell:8080/realms/Grafana/protocol/openid-connect/auth
token_url = http://dell:8080/realms/Grafana/protocol/openid-connect/token
api_url = http://dell:8080/realms/Grafana/protocol/openid-connect/userinfo
redirect_uri = http://localhost:3000/login/generic_oauth
role_attribute_path: contains(resource_access.grafana.roles[], 'admin') && 'Admin' || contains(resource_access.grafana.roles[], 'editor') && 'Editor' || (contains(grafana.roles[], 'viewer') && 'Viewer') #role mapping
Keycloak configuration
what am I doing wrong?