Hello, I have a problem with strava authentication. When the user logs in for the first time everything goes well. However, during subsequent connections it still requires authorization to connect to the Strava account instead of directly connecting it to my application. The approval_prompt parameter is of course "auto". I don't see where the problem could be. Thanks in advance
From the very sparse info you provided it would seem that you let known users every time connect to Strava instead of skipping this step on subsequent logins by using saved access tokens.
<Deleted>
authorization lasts 6 hours or so, meaning the token issued lasts 6 hours (7a), that last token (refresh token) issued is used again to re-authorize and issue a new refresh token https://developers.strava.com/docs/getting-started/#oauth
Every time a user logs in using strava to my site. It must each time authorize as above instead of being directly connected.
I see your using localhost, is your website redirecting localhost ? when it should be your website if so go to https://www.strava.com/settings/api and then edit and add your website, as when other users will be redirected after they accept using your API, I don't think localhost is allowed(does not work ?). also you may need to revoke access your in apps https://www.strava.com/settings/apps . what should happen is the refresh token authenticates in the background. your authentication should only happen once and then it will appear in the apps of every user who is using your app/api
Yes, I correctly entered the authorization domain but even in production, it asks me each time to authorize the application to access my Strava profile instead of connecting directly.
Here is mine - this is my url connection (button) https://www.strava.com/oauth/authorize?client_id=1921&response_type=code&scope=read,read_all,activity:read,activity:read_all,profile:read_all,activity:write,profile:write&approval_prompt=force&redirect_uri=https://lopeys.com/strava/authorize.php?lrurl=/strava/login.php change your client_id & scopes as I have both read & write and also your redirect url to point to your page, from there you have to process your tokens, I have shared some of my code.
@Dilhan973 Did you figure it out? Running into the same issue on localhost.
Never mind, figured it out, You need to request the "read" scope as well.
In my case:
Before: query.Add("scope", "activity:read");
After: query.Add("scope", "read,activity:read");
Thank you very much, that was exactly it.
Excellent. I was having the same issue. Looks like this was my problem as well. For those using Node.js Passport StravaStrategy use:
scope: 'read,activity:read_all''
Reply
Login to the community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.