zoffline / zwift-offline

Use Zwift offline
GNU Affero General Public License v3.0
650 stars 105 forks source link

Uploading activities to Strava #323

Closed oldnapalm closed 4 months ago

oldnapalm commented 5 months ago

The Strava's New Developer Program requests that all applications using their external API are submitted for review. The application used by zoffline can't comply and has stopped working, therefore users who have authorized activity uploading using the default client ID and secret will need to authorize again using their own API application, operating in "Single Player Mode".

Authorizing activity uploading

evgenybf commented 5 months ago

@oldnapalm is this OK that when zwift launcher is used, the strava-token.txt file doesn't appear in the storage directory and there is no button to download it? As soon as the client is authorized, I get redirected back to the Settings

=>

I guess, that in this case the token gets stored into the profile, right?

oldnapalm commented 5 months ago

The file strava_token.txt should be created in the directory storage/1 and the "Strava" button should become "Remove Strava token".

Do you see any error in the zoffline window?

evgenybf commented 5 months ago

No

INFO:zoffline:127.0.0.1 - - [2024-03-27 23:21:14] "GET /strava HTTP/1.1" 302 905 0.001001
INFO:stravalib.protocol.ApiV3:POST 'https://www.strava.com/oauth/token' with params {'client_id': xxx, 'client_secret': 'xxx', 'code': 'xxx', 'grant_type': 'authorization_code'} 
INFO:zoffline:127.0.0.1 - - [2024-03-27 23:21:19] "GET /authorization?state=&code=xxx&scope=read,activity:write HTTP/1.1" 302 537 0.599706
INFO:zoffline:127.0.0.1 - - [2024-03-27 23:21:19] "GET /settings/zoffline/ HTTP/1.1" 200 3630 0.001982
INFO:zoffline:127.0.0.1 - - [2024-03-27 23:21:19] "GET /style/site.css HTTP/1.1" 304 183 0.002012 
INFO:zoffline:127.0.0.1 - - [2024-03-27 23:21:19] "GET /style/background.jpg HTTP/1.1" 304 191 0.001003 
evgenybf commented 5 months ago

Hm.. but, now I see the file in storage/1 and the button "Remove Strava token"

evgenybf commented 5 months ago

Deleted the file manually and it was successfully re-created via the dialog. My apologies then. It works.

It may relate to the fact, that I set a proper launcher.zwift.com for the Strava app only today.

oldnapalm commented 5 months ago

Since the API application can be used only by one athlete I updated the launcher so that each user can enter their client ID and secret before authorizing, instead of requiring the file strava_api.txt in the storage directory. I think this makes more sense for servers with multiple users.

As of version 1.0.128160 these changes are included in the Windows release.