Google Identity Services is migrating to FedCM APIs. Follow the migration guide to review potential changes and avoid negative impacts for user sign-in to your website.
Stay organized with collections
Save and categorize content based on your preferences.
To facilitate your users to sign in or sign up, you can communicate with
multiple identity providers to find available credentials. You might want to
know our prompt UI status so that you can call the next identity provider.
To be notified about the prompt UI status at different moments, set a callback
function name to the data-moment_callback attribute, or a function to the
prompt() method if you use the JavaScript API.
Notifications are sent for the following moments:
Display moment: This occurs after the prompt() method is called. The
notification contains a boolean value to indicate whether the UI is
displayed or not.
Skipped moment: This occurs when the One Tap prompt is closed by an auto
cancel, a manual cancel, or when Google fails to issue a credential, such as
when the selected session is signed out of Google.
In this case, we recommend that you continue on to the next identity
providers, if there are any.
Dismissed moment: This occurs when Google successfully retrieves a
credential, or a user wants to stop the credential retrieval flow. For
example, when the user begins to input their username and password into
the login dialog, you can call the google.accounts.id.cancel() method to
close the One Tap prompt and trigger a dismissed moment.
The following code example implements a skipped moment:
<script>
functioncontinueWithNextIdp(notification){if(notification.isNotDisplayed()||notification.isSkippedMoment()){// try Next provider if One Tap is not displayed or skipped}}
</script>
...
<divid="g_id_onload"data-client_id="YOUR_GOOGLE_CLIENT_ID"data-login_uri="https://your.domain/your_login_endpoint"data-moment_callback="continueWithNextIdp"
</div>
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["Developers can customize the default login flow to better suit their application's needs."],["To determine whether to utilize additional identity providers, developers can monitor the prompt UI status using a callback function."],["The prompt UI status includes key moments like display, skipped, and dismissed, enabling developers to manage user login efficiently."],["When Google successfully retrieves credentials or the user stops the process (\"dismissed moment\"), avoid using other identity providers."],["The provided code example demonstrates how to handle the \"skipped moment\" and proceed with alternative login options."]]],[]]