Skip to content

Instantly share code, notes, and snippets.

@mbmccormick
Created September 22, 2012 15:03
Show Gist options
  • Save mbmccormick/3766456 to your computer and use it in GitHub Desktop.
Save mbmccormick/3766456 to your computer and use it in GitHub Desktop.
Authorize desktop application with Fitbit API
Authenticator authorizer = new Authenticator("YOUR_CONSUMER_KEY", "YOUR_CONSUMER_SECRET",
"http://api.fitbit.com/oauth/request_token",
"http://api.fitbit.com/oauth/access_token",
"http://www.fitbit.com/oauth/authorize");
string url = authorizer.GetAuthUrlToken();
Console.WriteLine("Authorization URL: " + url);
string tempAuthToken;
string verifier;
Console.Write("tempAuthToken: ");
tempAuthToken = Console.ReadLine();
Console.Write("verifier: ");
verifier = Console.ReadLine();
AuthCredential credential = authorizer.ProcessApprovedAuthCallback(tempAuthToken, verifier);
Console.WriteLine(credential.AuthToken);
Console.WriteLine(credential.AuthTokenSecret);
Console.ReadLine();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment