谷歌一键注册总是返回noCredentialsAvailable [英] Google one tap sign up always returns noCredentialsAvailable

查看:194
本文介绍了谷歌一键注册总是返回noCredentialsAvailable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为新的Google点击设置了一个简单的骨骼测试登录/注册。

I have set up a bare bones test for the new google one tap sign in / sign up.

<!DOCTYPE html>
<html lang="en">

<head></head>

<body>
  <script src="https://smartlock.google.com/client"></script>
  <script>
    window.onGoogleYoloLoad = (googleyolo) => {
      googleyolo.hint({
        supportedAuthMethods: [
          "https://accounts.google.com"
        ],
        supportedIdTokenProviders: [{
          uri: "https://accounts.google.com",
          clientId: "xxxxx-xxxxx.googleusercontent.com"
        }],
        context: "signUp"
      }).then((credential) => {
        console.log(credential);
      }, (error) => {
        console.log(error.type);
      });
    };
  </script>
</body>

我希望上面要么将凭证对象吐出到控制台,要么提示我选择登录的Google帐户。而是抛出noCredentialsAvailable错误类型。当我使用 googleyolo.retrieve 承诺时也会发生这种情况。

I expected the above to either spit out the credential object to the console, or to prompt me to choose a google account to log in with. Instead a "noCredentialsAvailable" error type is thrown. This also happens when I use the googleyolo.retrieve promise.

我目前:


  • 有一个谷歌帐户登录和其他谷歌登录oauth流程工作

  • 我在localhost加载上述内容:3000 (在我的google api凭证页面上也列为授权来源)

我缺少什么?

推荐答案

我们刚刚发布了一些故障排除指南: https://developers.google.com/identity/one-tap/web/troubleshooting

We just published some troubleshooting guidance: https://developers.google.com/identity/one-tap/web/troubleshooting

最重要的事情检查以下内容:

The most important things to check are the following:


  • 确保您拥有有效的Google帐户并启用了智能锁功能。我们正在努力尽快删除这些要求,但是现在,请尝试使用默认设置的常规Gmail帐户

  • ensure that you have an active Google Account and that the Smart Lock feature is enabled. We are working on removing these requirements asap, but for now, try with a regular gmail account with default settings

确保您提供的是Google客户端ID任何请求以及您运行代码的域是授权来源,包括端口。有关详细信息,请参阅文档。

make sure that you supply a Google client ID in any requests and that the domain you are running the code is an authorized origin, including the port. See documentation for details

检查您是否使用支持的用户代理。重要的是,Chrome开发工具中的iOS模拟模式已过期(修复待处理)

check that you are using a supported user-agent. Importantly, the iOS emulation modes in Chrome Dev Tools are out-of-date (fix pending)

如果您仍然无法让它运作,或者有任何反馈,我们很乐意听取您的意见:联系sso@google.com

If you still cannot get it working, or have any feedback at all, we'd love to hear from you: reach out to sso@google.com

这篇关于谷歌一键注册总是返回noCredentialsAvailable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆