Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Store tokens in database

Hi! I want to allow my app's users to integrate with fitbit. My backend application should get users data regardless they are online. Can I store user tokens in my database after they authorized themself? Is it a good solution for this problem?

Best Answer
0 Votes
1 REPLY 1

Hi @Johndev 

 

Integrating with the Web APIs sounds like the correct solution for you.   After a user consents to share their data with your application, you'll receive an access token and a refresh token.   You should store both of these items, and in a database is fine.  The access token is used to fetch the user's data, and the refresh token is used to update the access token and refresh token when the access token expires.   I recommend you implement the Subscription API so your application gets notified when the user has new data to download.

 

If you need more information, please let us know.

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes