lorenzobenvenuti / strava-cli

Command Line Interface for Strava
MIT License
4 stars 1 forks source link

Authentication not possible #1

Closed bebablub closed 4 years ago

bebablub commented 4 years ago

Hello,

i'm having problems with authentication (and your latest master). Steps to reproduce:

python2 ./strava-cli.py authenticate -i -s

results in:

Navigate to http://localhost:8080 using your web browser and perform the authorization flow. Press CTRL-C to abort

  • Serving Flask app "auth" (lazy loading)
  • Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Debug mode: off

So far so good. After browsing to:

http://localhost:8080

i'm redirected to:

https://www.strava.com/oauth/authorize?client_id=&response_type=code&redirect_uri=http://localhost:8080/token&scope=view_private,write

which says

{"message":"Bad Request","errors":[{"resource":"Authorize","field":"scope","code":"invalid"}]}

I'm pretty sure it has something todo with: https://developers.strava.com/docs/authentication/#refreshingexpiredaccesstokens https://developers.strava.com/docs/oauth-updates/ Strava disabled all livetime access tokens this week.

Is it possible to update your script to work with the new OAuth flow and refresh tokens?

Thank you very much for your work!

Best regards!

lorenzobenvenuti commented 4 years ago

Hi, I implemented a quick fix in branch tokens; code needs some refactoring before it can be merged into master, but it should work.

Thanks!

lorenzo

bebablub commented 4 years ago

Hi! checked out your branch and it seems to fix the auth issues. Thank you very much for the help and fast reaction :)

Best regards!

lorenzobenvenuti commented 4 years ago

Merged to master.