Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string ClientId = "client id";
- public static string ClientSecret = "client secret";
- public static string Scope = "email";
- public static string AuthorizeUrl = "https://m.facebook.com/dialog/oauth";
- public static string RedirectUrl = "https://www.facebook.com/connect/login_success.html";
- public static string AccessTokenUrl = "https://m.facebook.com/dialog/oauth/token";
- public class AuthenticationPageRenderer : PageRenderer
- {
- public override void ViewDidAppear(bool animated)
- {
- base.ViewDidAppear (animated);
- var auth = new OAuth2Authenticator (
- Constants.ClientId,
- Constants.ClientSecret,
- Constants.Scope,
- new Uri (Constants.AuthorizeUrl),
- new Uri (Constants.RedirectUrl),
- new Uri (Constants.AccessTokenUrl)
- );
- auth.Completed += OnAuthenticationCompleted;
- PresentViewController (auth.GetUI (), true, null);
- }
- async void OnAuthenticationCompleted (object sender, AuthenticatorCompletedEventArgs e)
- {
- Debug.WriteLine ("AUTH Completed!");
- if (e.IsAuthenticated) {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement