Skip to content
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

Fitbit: Integrate authlib instead of doing oauth manually #43

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

caarmen
Copy link
Owner

@caarmen caarmen commented Jan 20, 2024

Add compliance hooks for fitbit behavior which deviates from default behavior expected by authlib.

Regarding refreshing the token:

  • Remove our custom decorator which was refreshing the token upon a 401 error to a resource request.
  • When we get/refresh our access token, save it in the db with an expiration date which is a few minutes sooner than the real one. This will help ensure that we'll fetch a new token when we want to do a resource request and our token is about to expire.

@caarmen caarmen changed the title [WIP] Use authlib for fitbit Fitbit: Integrate authlib instead of doing oauth manually Jan 20, 2024
Add compliance hooks for fitbit behavior which deviates from default behavior expected by authlib.

Regarding refreshing the token:
* Remove our custom decorator which was refreshing the token upon a 401 error to a resource request.
* When we get/refresh our access token, save it in the db with an expiration date which is a few minutes sooner than the real one. This will help ensure that we'll fetch a new token when we want to do a resource request and our token is about to expire.
* Adapt `test_retry_authentication` to be `test_refresh_token`
@caarmen caarmen marked this pull request as ready for review January 20, 2024 15:17
@caarmen caarmen merged commit 21a071d into authlib Jan 20, 2024
@caarmen caarmen deleted the authlib-fitbit branch January 20, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant