Hello Grafana Community,
I’m currently working on a project where I need to integrate data from an external API into Grafana. The API outputs JSON data and requires an access token for authentication. The access token expires every hour and needs to be refreshed.
To obtain the access token and refresh token, I need to authenticate with my email and password to a specific endpoint. Once I have the refresh token, I can use it to refresh the access token every hour at another endpoint.
I’ve been using the JSON API data source plugin to load data from the API into Grafana. I’ve set up the data source with the access token in the Authorization header. However, I’m running into an issue with the token expiration. Since the token expires every hour, I need to manually update it in the data source configuration, which is not feasible for our use case.
I’ve read the Grafana documentation and searched the forum, but I couldn’t find a clear solution to this problem.
Does Grafana support automatic token refresh for data sources? If so, could you please guide me on how to configure this? If not, do you have any suggestions for a workaround? I’m considering setting up a backend service to handle the token refresh and update the token in Grafana’s data source configuration, but I’m hoping there might be a simpler solution.
Any guidance or suggestions would be greatly appreciated. Thank you in advance for your help!