Authenticate grafana API request with keycloak access token

  • What Grafana version and what operating system are you using?
    Grafana v9.3.2 deployed with helm on kubernetes

  • What are you trying to achieve?
    I want to authenticate a grafana API request with a keycloak oauth access token.
    (Background: I cannot use an API key because if grafana crashes, the database and the API key will be lost so there would always be manual handling necessary and it cannot be automated.)

  • How are you trying to achieve it?
    Use keycloak access token just like an API Token as a Bearer token in the grafana API request.

  • What happened?
    invalid API key

  • What did you expect to happen?
    I expected that the API request would be authenticated.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    {“message”:“invalid API key”,“traceID”:“”}