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:
What am I missing?
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]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With