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

Persistent Authentication

Hello,

 

I am developing a Web Application in ASP.NET which needs to integrate with FitBit. I have completed my proof of concept by following the API .NET Client guide.

 

 My issue now is I would like to be able to store authentication allowing the web application to seamlessly retrieve data from the API without requiring the user to login or click "Allow" each time the user logs into my application.

 

Is there a way to persistently store the access token allowing the user to only allow access once instead of each time the application runs? I'm fairly new to OAuth so I apologize if my terminology is incorrect.

 

Thanks,

Hussain

Best Answer
0 Votes
3 REPLIES 3

Hello, you only need the Fitbit user to grant you access once. Once user grants access for your app to use his data, just save user access token and user access token key to the storage of your choice and  after that you can just re-use these user access token and user access token secret until user denies access(if he decides so) to your app.

 

User can do it in his profile settings at fitbit.com

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

Thank you for your reply. Unfortunately I am still confused, I’m not sure what the difference is between the user access token and the user access token key. The only access token I see in the example is the one defined by response.Token.

 

Furthermore, I am having trouble implementing code into my own project. In the example project the code runs without fault. However no matter where I seem to try to implement the code in my project, I am met with the error “Object reference not set to an instance of an object.”

This error is thrown on the line OAuthService service = OAuthService.Create(…);

 

I tried setting the service variable to a new instance of the OAuthService object with:

OAuthService service = new OAuthService();

But then an error comes saying there is no constructor for OAuthService() so it cannot be declared that way.

I have added all of the references and entries in my project that exist in the example project, but no avail.

 

Thank you for your help,

Hussain

 

Best Answer
0 Votes

Hello

please check out https://wiki.fitbit.com/display/API/OAuth+Authentication+in+the+Fitbit+API

 for more details on what kind of objects are used for oauth 1.0a.

 

Also check out this post: https://community.fitbit.com/t5/Web-API/How-to-properly-sign-API-request-and-set-up-OAuth-1-0a-flow/...

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes