stravalib icon indicating copy to clipboard operation
stravalib copied to clipboard

feat(docs): add strava authentication tutorial

Open lwasser opened this issue 2 years ago • 3 comments

This PR adds a tutorial on authenticating with the Strava V3 api.

Type of change

Select the statement best describes this pull request.

  • [x] This is a documentation update

Does your PR include tests

If you are fixing a bug or adding a feature, we appreciate (but do not require) tests to support whatever fix of feature you're implementing.

  • [x] This change doesn't require tests

lwasser avatar Jan 13 '23 21:01 lwasser

hey y'all... i can resolve the conflicts but i want some eyes on this workflow. It's the closet thing I can think of to implement the token exchange without having a server running. i haven't been able to figure out how you'd do it with requests because there is a login step.

id love some eyes on this. i have some helper functions that i created to do the token refresh so if this workflow seems reasonable i can turn the script into a few functions and then explain the functions.

Thank you in advance for reviewing!!

lwasser avatar Jan 13 '23 21:01 lwasser

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.62%. Comparing base (5576224) to head (62a44e8). Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #317   +/-   ##
=======================================
  Coverage   89.62%   89.62%           
=======================================
  Files           9        9           
  Lines        1890     1890           
  Branches      182      182           
=======================================
  Hits         1694     1694           
  Misses        153      153           
  Partials       43       43           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 06 '24 22:09 codecov[bot]

Ok 1.5+ years later this is ready for another review ✨ It's a little clunky working with that refresh token. I keep wondering (but am not sure) if it would be better to store that token and the expires_at value in the client object as attributes. @jsamoocha @enadeau let me know what you think about that. I go back and forth on it. I would assume for an app, you have a database where the refresh token would be stored. But for a user running a workflow, it could be nice to do a client.expires_at to check whether the token needs a refresh.

lwasser avatar Sep 07 '24 17:09 lwasser