Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google one tap sign up always returns noCredentialsAvailable

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>

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.

I currently:

  • have a google account signed in and other "google sign in" oauth flows work
  • am loading the above at localhost:3000 (which is also listed as an authorised origin on my google api credentials page)

What am I missing?

like image 498
Richard Williams Avatar asked Oct 29 '17 09:10

Richard Williams


1 Answers

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

The most important things to check are the following:

  • 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

  • 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

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

If you still cannot get it working, or have any feedback at all, we'd love to hear from you: reach out to [email protected]

like image 144
Steven Avatar answered Oct 26 '22 16:10

Steven