-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strava datasource cannot connect to Strava API - Bad Request or 401 Unauthorized #70
Comments
Let me know if I should open a new issue, but mine seems pretty similar if not the same. I'm using Cloud Grafana on the latest main (v9.5.0-52717pre (c5ed9391b6)) and the Strava plugin on version 1.5.1. What I've experienced:
|
hello! same here |
Same here. Running Grafana in docker using the latest tag .
Much like doriand's case, I can see that API requests have made it to my Strava account, but obviously nothing is being retrieved. |
Hi, have you tried to clear your web browser cache ? |
@quentinlegay just tried clearing my cache as well as trying a different browser and I'm met with the same result (401 unauthorized) |
Having similar issues with Grafana 9.4.7 and and freshly installed Strava Datasource 1.5.1. |
With a local installation, defining the IP address of the instance resolved the challenge, ie. not using "localhost" definition (like the documentation quickly reading states). |
@mdrocan Hi, can you describe where and what did you configured differently please? |
@dorinand I added the correct intranet's IP address to Strava's API definition (https://www.strava.com/settings/api) , ie. "Authorization Callback Domain". Ie. I had 'localhost' defined there, like mentioned in https://github.com/grafana/strava-datasource/blob/master/docs/configuration.md, which didn't work. Instead the correct IP address works. |
This still seems to be a bit broken (might be related to issue #75?). After adding the correct "Authorization Callback Domain" in the strava API settings - which is just my reverse proxy URL for the grafana instance running in docker - I am able to get to the strava authorization screen as shown below: Clicking "Authorize" seems to complete successfully - no errors or logs appear. Looking at the logs I have:
To add to the issue, I have tried the "Forward OAuth identity" as outlined in the docs, however the docs describe a toggle which is no longer available?
|
@lennon101 forward oauth identity only available in the latest plugin version 1.6.0. |
@mdrocan I updated configuration docs, hope it's more clear now. |
@natellium Unfortunately, there's an issue with Grafana cloud. Since instance starts in the new container every time, the only available long-term storage is a DB. But plugin do not have access to DB, so refresh token will be removed on instance restart. |
@alexanderzobnin can't remember now in which way did I set it up in my current raspberry in the internal network, but yes it works for me. |
@mdrocan yes, in case you use grafana at raspberry pi, you need to configure callback domain to exact address you use to open grafana ( |
I also used this awesome plugin on Grafana Cloud and faced this problem. |
I am still facing this issue in both Grafana cloud and and with a docker image as well. |
how do I check what version of the plugin I'm using? and how do I update to the latest version? @alexanderzobnin |
@lennon101 you can check it from Grafana - Administration - plugins in side navigation menu |
Ok thanks. I'm now updated and running version 1.6.1 but the issue remains. I am clicking on OAuth --> connect with STRAVA --> which navigates me to the strava auth page --> I tap "authorize" and I am navigated back to Grafana where a pop-up appears in the top right hand corner saying: System details: |
Any fix known? Version 1.3.0 works properly, but having the same 401 error when using newer versions. |
Configured strava datasource But when I try to retrieve a data I got a
|
Could you try it with forward identity method? https://github.com/grafana/strava-datasource#forward-oauth-identity |
I'm facing same the same issue.
When I click Explore view, I get "Error Status: 401 Unauthorized" when exploring the Strava data source. If I set "Forward OAuth identity" = true, and click "Save and Test", I also get a 401 If I choose "Auth Type" = "refresh token", and enter details from Strava API application (client id and secret + refresh token), then "Save and Test" always fails. |
I've also failed setting up strava connection with forward oauth identity enabled. Documentation says to configure [auth.generic_oauth] section in grafana but I don't have access to grafana config. At least I was not able to find one. The setup is identical to what @strandbygaard have |
I was able to get it working, here is what I did: |
I've updated plugin authentication, now it should work on Grafana Cloud without re-authentication after instance restart. Upgrade plugin to latest version. |
Hi, I just updated to the latest version (1.7.0) and I'm still having similar issues. Tried connect with strava button and apparently worked but when I go to explore data it warns me with the message that the refresh token is missing |
Ok, that's strange, I think I noticed a similar issue but after re-connecting everything was fine. |
Hi, Been at this for days.. logger=context userId=1 orgId=1 uname=admin t=2024-03-25T19:37:17.749686766Z level=info msg="Request Completed" method=GET path=/api/live/ws status=-1 remote_addr=192.168.1.62 time_ms=2 duration=2.257232ms size=0 referer= handler=/api/live/ws status_source=server logger=plugin.grafana-strava-datasource t=2024-03-25T19:37:21.026425305Z level=info msg="Starting background prefetcher" logger=plugin.grafana-strava-datasource t=2024-03-25T19:37:21.026523831Z level=error msg="Error loading refresh token" logger=plugin.grafana-strava-datasource t=2024-03-25T19:37:21.026555422Z level=error msg="Error fetching activities" error="error fetching activities: Refresh token not found, authorize datasource first" logger=plugin.grafana-strava-datasource t=2024-03-25T19:37:21.924226662Z level=error msg="Error saving refresh token" err="Get "/api/datasources/uid/fdgr8jy7j3caoa": unsupported protocol scheme """ logger=plugin.grafana-strava-datasource t=2024-03-25T19:37:22.022450062Z level=info msg="Cache has been reset" datasource=grafana-strava-datasource logger=plugin.grafana-strava-datasource t=2024-03-25T19:37:22.116460359Z level=error msg="Error loading refresh token" logger=plugin.grafana-strava-datasource t=2024-03-25T19:37:22.116534567Z level=error msg="Strava API request error" error="Refresh token not found, authorize datasource first" logger=context userId=1 orgId=1 uname=admin t=2024-03-25T19:37:22.117265322Z level=error msg="Request Completed" method=POST path=/api/datasources/21/resources/strava-api status=500 remote_addr=192.168.1.62 time_ms=3 duration=3.804035ms size=97 referer="http://es-docker.jaya:3000/connections/datasources/edit/fdgr8jy7j3caoa?code=76ada3ac08fed6ca5df5c8131ba&scope=read%2Cactivity%3Aread_all%2Cprofile%3Aread_all%2Cread_all&state=" handler=/api/datasources/:id/resources/* status_source=downstream |
Update!!! plugin version 1.6.0 works!! although it complains about deprecated Angular Plugin!!
|
@GKG-ctrl seems like the problem is here:
I'll take a look, maybe something was changed in latest grafana |
@GKG-ctrl what's your |
@alexanderzobnin
|
@GKG-ctrl could you confirm that you have Grafana 10.1 or higher? I added default url just in case, but want to make sure there's no other issues. |
I have the same error. I use the latest version of Grafana and also have it in a docker container. |
Ok, maybe docker is a source of problem. I'll test it out. |
Hi, Yes i am using docker and grafana 10.4.
regards
…On Tue, Apr 2, 2024 at 1:23 PM Alexander Zobnin ***@***.***> wrote:
Ok, maybe docker is a source of problem. I'll test it out.
—
Reply to this email directly, view it on GitHub
<#70 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARFG7KEZWO5VD2BPYEL4SSLY3KIMFAVCNFSM6AAAAAAVAR2JO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZRG42TCNZXGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I've made some fixes and improvements in auth process, you can upgrade to 1.7.1 and try again. Not sure it fixes your error, I could not manage to replicate it exactly, but have some related fixes. |
Just updated to 1.7.1 and finally worked for me. Thank you so much! |
Thank you very much! This update worked .. the deprecated angular plugin error remains but that’s a minor issue . It’s working !! I tested on docker and also on homeassistant grafana addon and it also works! |
That's a bit strange, I'll double check it. Maybe it's a bug in Grafana, there's definitely no angular code in the plugin. |
I installed strava plugin into Grafana. I tried to configure datasource with both options OAuth and Refresh token, bot none of them works.
OAuth
When I press Connect with STRASVA, new tab is opened with error:
Refresh token
This option show information, that
Data source is working
.When I open New Dashboard and switch to my Strava datasource, I receive immediately 401 error:
From Strava API dashboard I can see, api calls have been made:
The text was updated successfully, but these errors were encountered: