Guest User

Untitled

a guest
Aug 11th, 2012
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. openid in an app?
  2. var s = new TwitterService("key", "secret");
  3.  
  4. // Step 1 - Retrieve an OAuth Request Token
  5. OAuthRequestToken requestToken = s.GetRequestToken();
  6.  
  7. // Step 2 - Redirect to the OAuth Authorization URL
  8. Uri uri = s.GetAuthorizationUri(requestToken);
  9. Process.Start(uri.ToString());
  10.  
  11. // Step 3 - Exchange the Request Token for an Access Token
  12. string verifier = Console.ReadLine(); //user types pin from website
  13. OAuthAccessToken access = s.GetAccessToken(requestToken, verifier);
  14.  
  15. // Step 4 - User authenticates using the Access Token
  16. s.AuthenticateWith(access.Token, access.TokenSecret);
  17. var name = s.GetUserProfile().Name;
  18. Console.WriteLine(name);
Advertisement
Add Comment
Please, Sign In to add comment