Created
September 22, 2012 15:03
-
-
Save mbmccormick/3766456 to your computer and use it in GitHub Desktop.
Authorize desktop application with Fitbit API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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