Esempio n. 1
0
 public GoogleAuthenticator(string clientId, string scope, string redirectUrl, IGoogleAuthenticationDelegate authenticationDelegate)
 {
     _authenticationDelegate = authenticationDelegate;
     _auth = new OAuth2Authenticator(clientId, string.Empty, scope,
                                     new Uri(AuthorizeUrl),
                                     new Uri(redirectUrl),
                                     new Uri(AccessTokenUrl),
                                     null, IsUsingNativeUI);
     _auth.Completed += OnAuthenticationCompleted;
     _auth.Error     += OnAuthenticationFailed;
 }
Esempio n. 2
0
        public void Autheticate(IGoogleAuthenticationDelegate googleAuthenticationDelegate)
        {
            GoogleAuthenticatorHelper.Auth = new GoogleAuthenticator(
                "964681194779-8219jilqvq65g6b9pafmqsohfcnj7m0k.apps.googleusercontent.com",
                "email",
                "com.jdc.OAuth:/oauth2redirect",
                googleAuthenticationDelegate);

            // Display the activity handling the authentication
            var authenticator = GoogleAuthenticatorHelper.Auth.GetAuthenticator();
            var intent        = authenticator.GetUI(MainActivity);

            MainActivity.StartActivity(intent);
        }
Esempio n. 3
0
        public GoogleAuthenticator(string clientId, string scope, string redirectUrl, IGoogleAuthenticationDelegate authenticationDelegate)
        {
            _authenticationDelegate = authenticationDelegate;

            _authAuthenticator = new OAuth2Authenticator(clientId, string.Empty, scope,
                                                         new Uri(AUTORIZE_URL),
                                                         new Uri(redirectUrl),
                                                         new Uri(ACCESS_TOKEN_URL),
                                                         null, IS_USING_NATIVE_UI);

            _authAuthenticator.Completed += ProcessAuthenticationCompleted;

            _authAuthenticator.Error += ProcessAuthenticationFailed;
        }
Esempio n. 4
0
        public GoogleAuthenticator(string clientId, string scope, string redirectUrl, IGoogleAuthenticationDelegate authenticationDelegate)
        {
            authDelegate        = authenticationDelegate;
            current_clientId    = clientId;
            current_scope       = scope;
            current_RedirectUrl = redirectUrl;
            UserInfo            = new GoogleUserInfo();

            auth = new OAuth2Authenticator(clientId, string.Empty, scope,
                                           new Uri(AuthorizeUrl),
                                           new Uri(redirectUrl),
                                           new Uri(AccessTokenUrl),
                                           null, IsUsingNativeUI);

            auth.Completed += OnAuthenticationCompleted;
            auth.Error     += OnAuthenticationFailed;
        }
Esempio n. 5
0
        public void Autheticate(IGoogleAuthenticationDelegate googleAuthenticationDelegate)
        {
            GoogleAuthenticatorHelper.Auth = new GoogleAuthenticator(
                "964681194779-p8ipbmur4s777ljpinhcd68hla5r540g.apps.googleusercontent.com",
                "email",
                "com.jdc.OAuth:/oauth2redirect",
                googleAuthenticationDelegate);

            GoogleAuthenticatorHelper.Auth.AuthenticationDone += Auth_AuthenticationDone;

            // Display the activity handling the authentication
            var authenticator = GoogleAuthenticatorHelper.Auth.GetAuthenticator();

            var viewController        = authenticator.GetUI();
            var currentViewController = GetCurrentViewController();

            currentViewController.PresentViewController(viewController, true, null);
        }