Token authentication in Proxy Route

We have a REST API, which uses token-based authentication. Initially, We need to pass ClientID & Client Secret to an auth end point, Get the token and pass the token for the functional API calls. I see Grafana Proxy routes talk about token auth.

{
  "routes": [
    {
      "path": "api",
      "url": "https://api.example.com/v1",
      "tokenAuth": {
        "url": "https://api.example.com/v1/oauth/token",
        "params": {
          "grant_type": "client_credentials",
          "client_id": "{{ .SecureJsonData.clientId }}",
          "client_secret": "{{ .SecureJsonData.clientSecret }}"
        }
      }
    }
  ]
}

Is it mean, Before the functional API call is made, Grafana will get the token first and use it for the above API calls?

While this is being supported, i do see an issue here.

Though the response consists of “expires_in” field, still the token is not considering this field to calculate “expires_at” timestamp and considering token as expired.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.