strava-datasource: Refresh token not found error
Hi,
This looks to be a great plugin but I am having trouble connecting to the Strava API.
I am running a grafana server locally in a docker container but I am getting the following error:
Refresh token not found, authorize datasource first
I have done the following:
- Install the plugin in the docker container with the following command
grafana-cli plugins install grafana-strava-datasource
- Restart the docker container
- Create a directory
/var/lib/grafana/strava
- Define an environment variable
export GF_STRAVA_DS_DATA_PATH=/var/lib/grafana/strava/
- Add a datasource specifying the
Client ID
andClient Secret
from an app created in my Strava account - I get the following messages
Do you know how I can solve this issue please?
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 41 (6 by maintainers)
Commits related to this issue
- Authenticate with preconfigured refresh token, #31 — committed to grafana/strava-datasource by alexanderzobnin 3 years ago
Hey, I’m still getting errors trying to work with the strava datasource.
When I add it it says everything is fine, but when trying to use it I get:
Error status: 401 Unauthorized
With the following logsLooking in the logs when adding the data source i get the following:
But in the gui it reports as a success:
I’m running on grafana version
v9.1.2 (3c13120cde)
I finally made it work after deleting and recreating the datasource from the grafana UI
Also, make sure
externalServiceAccounts
feature is enabled: https://github.com/grafana/strava-datasource?tab=readme-ov-file#enable-externalserviceaccounts-featureI changed a fallback for data directory, now if
GF_STRAVA_DS_DATA_PATH
is not set, files will be created in default OS cache directory (understrava-datasource
subfolder). Hope, I will fix issues when token is writing into the file in the root directory. Changes were made in 22a87da1dd4f8b4a17d865e9dfb5d610e3fef1f0 and 7eaddba777394ecc13142befdc2f8a908736e803.@yihong0618 Using refresh token from the application page might be a good idea if you’re using plugin only for your personal access. But in general, one Strava application can be used for accessing multiple users. In this case each user will have its own refresh token. This is why I went recommended way for Strava authentication. I think I can add support for specifying refresh token for access your own data only.
@bullboa the same issue as above - since you’re on the
grafana.com
domain, you have to configure strava app domain callback to match it, like