Google 登录错误 Windows 10 UAP 应用程序

Google login error On Windows 10 UAP application

我在 Windows 10 上遇到了这个奇怪的问题,我使用的代码与我的 Windows 8.1 应用程序相同,但我无法对 Google 登录进行身份验证直接通过。

我做错了什么?

public async Task<string> LogIntoGoogle()
        {
            try
            {
               credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                    new Uri("ms-appx:///Assets/client_secrets.json"),
                    new[] { "https://www.googleapis.com/auth/plus.profile.emails.read" },
                    "user",
                    CancellationToken.None);

                return credential.Token.AccessToken;

            }
            catch (Exception exe)
            {

                var data = exe;
            }
            return "";
        }

编辑:看起来我只有 2 个 google 参考文献:

Edit2:是的,我错过了 Google.Api.Core 参考。

您确定您拥有所有正确的参考资料吗? Google 登录?你应该有 3.

更新:您似乎缺少 Google.Api.Core 参考资料