Reputation: 17784
I need to integrate with Fitbit API. it uses OAuth 1.0 for authentication. Can I call API from a .NET desktop application. I have seen code snippets with OAuth.NET but they are calling the API from web application. Let me further expand the question
Can I make Oauth request from a desktop application if yes how? I have read somewhere on the net that twitter allows its clients to call from desktop app.
My desktop app will not have any URL,so what will be the value of CallBackURL when creating OAuth.NET request. review the following code for detail
OAuthRequest request = OAuthRequest.Create(
new EndPoint(ApiCallUrl, "GET"), // API call url
service, // consumer configuration
this.Context.Request.Url, // callback url
this.Context.Session.SessionID // session id
);
Upvotes: 1
Views: 1193
Reputation: 4108
I know this is a bit late to the party but here we go ...
You have to set your application at fitbit.com to be a desktop application and then once a user is authenticated it will provide you with a pin number to hook it all up. Once you have that pin token you can create a session etc. To enable this your application needs to launch a browser process, either spawn a new process or have an embedded browser, to allow for the user to enter their credentials and authorize the application.
Please take a look at https://github.com/aarondcoleman/Fitbit.NET/tree/master/SampleDesktop for reference.
Upvotes: 1