Xamarin.Auth和Google云端硬盘API:未验证OAuth2Authenticator

时间:2020-08-03 01:03:35

标签: xamarin.forms google-drive-api xamarin.auth

这就是我启动登录页面的方式:

this.OnGoogleDrive = new Command(() =>
            {
                var presenter = new OAuthLoginPresenter();
                presenter.Login(auth);
            });

这就是我定义身份验证器的方式:

var auth = new OAuth2Authenticator(
              this.clientId,
              string.Empty,
              scope,
              new Uri("https://accounts.google.com/o/oauth2/v2/auth"),
              new Uri(redirectUrl),
              new Uri("https://www.googleapis.com/oauth2/v4/token"),
              isUsingNativeUI: true);

因此,我的应用会打开一个页面,其中会显示Google登录页面并授权我的范围。最后,它显示了一个我必须复制粘贴的代码。到目前为止,我认为该页面将使IsAutheticated为true。但是当我到达处理Completed事件的方法时,它被读为false。 这是为什么?我使用错误的方式打开“登录”页面吗?

0 个答案:

没有答案
相关问题