Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. public static string ClientId = "client id";
  2. public static string ClientSecret = "client secret";
  3. public static string Scope = "email";
  4. public static string AuthorizeUrl = "https://m.facebook.com/dialog/oauth";
  5. public static string RedirectUrl = "https://www.facebook.com/connect/login_success.html";
  6. public static string AccessTokenUrl = "https://m.facebook.com/dialog/oauth/token";
  7.  
  8. public class AuthenticationPageRenderer : PageRenderer
  9. {
  10. public override void ViewDidAppear(bool animated)
  11. {
  12. base.ViewDidAppear (animated);
  13.  
  14. var auth = new OAuth2Authenticator (
  15. Constants.ClientId,
  16. Constants.ClientSecret,
  17. Constants.Scope,
  18. new Uri (Constants.AuthorizeUrl),
  19. new Uri (Constants.RedirectUrl),
  20. new Uri (Constants.AccessTokenUrl)
  21. );
  22.  
  23. auth.Completed += OnAuthenticationCompleted;
  24. PresentViewController (auth.GetUI (), true, null);
  25. }
  26.  
  27. async void OnAuthenticationCompleted (object sender, AuthenticatorCompletedEventArgs e)
  28. {
  29. Debug.WriteLine ("AUTH Completed!");
  30. if (e.IsAuthenticated) {
  31.  
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement