Warning: This data is provided under the Google User Data Policy. Please review and comply with the policy. Failure to do so might result in project or account suspension.

Overview

Sign In With Google helps you to quickly and easily manage user authentication and sign-in to your website. Users sign into a Google Account, provide their consent, and securely share their profile information with your platform.

Customizable buttons and multiple flows are supported for user sign up and sign in.

Sign up refers to the steps to obtain a Google Account holder's consent to share their profile information with your platform. Typically, a new account is created on your site using this shared data, but this is not a requirement.

Sign in refers to user login to a Google Account using a personalized sign-in button or One tap and Automatic sign in for users already logged in to their Google Account.

User privacy

Data from Sign In With Google is not used for ads or other non-security purposes.

Use cases

Some of the reasons to add Sign In With Google to your site are:

  • Add a visibly trusted and secure Sign In With Google button to an account creation or settings page.
  • Pre-populate new accounts with consensually shared data from a Google Account profile.
  • Sign in once to a Google Account without re-entering usernames or passwords on other sites.
  • On return visits sign in automatically or with one click across an entire site.
  • Use verified Google Accounts to protect comments, voting or forms from abuse, while allowing anonymity.

Supported features

These features are supported by Sign In With Google:

  • Sign up, to optionally create a new account auto-filled from a Google Account profile.
  • Sign in, using an account chooser to select from multiple accounts.
  • Sign in with One tap, if you've already signed in to your Google Account.
  • Sign in Automatically, on return visits from using your computer, phone or even multiple browser tabs.
  • Sign out, to disable automatic sign in across all your devices.
  • Suspending your Google Account stops sign in to all sites using Sign In With Google.
  • Deleting your Google or partner account affects one, but not the other.
  • Use a third-party identity provider or sign up directly if you choose not to share your Google Account profile with a site.

Migrating to the Sign In With Google button

If your site already makes use of the existing Google Sign-In button, migrating to the new Sign In With Google button is simple and offers a number of advantages:

  • A personalized experience enables users to view a profile picture to identify or choose from multiple Google Accounts, thereby decreasing sign up and sign in friction.

  • With user trust and safety in mind we've improved privacy controls and increased visibility for any data that is shared.

  • A consistent look and feel across the Internet improves user trust versus inconsistent Google Sign-In branding.

  • For developers, we've redesigned our libraries to require less coding and effort on your part.

  • Additionally, these changes are intended to isolate and minimize risk as we rollout out new features and security changes such as disabling third-party cookies.

See our migration guide for more.

How it works

A JavaScript library is included in your site and HTML or JavaScript is used to customize the look and feel of the personalized button and One tap, Automatic sign in and sign out behaviors.

Google Account sign-in

For Sign In With Google to work, there should be an active Google session in the browser. One Tap and Automatic sign-in are triggered only when users have signed in to Google before loading your web pages. With the Sign In With Google button flow, users are prompted to sign-in to Google when the button is pressed, establishing an active Google session:

Alt text

and then sign in to the Google Account:

Alt text

Next, Google confirms the Google Account owner has given consent to share their profile with your app.

If they've not already done so, users visiting your site are prompted for consent to share their Google Account profile information with your app.

When One Tap is enabled users will be presented with the consent and sign-in dialog:

Alt text

If users have previously signed in to your app and granted consent, the personalized button will be displayed and clicking the button will directly sign users into your site.

Alt text

Otherwise, an unpersonalized button is shown:

Alt text

Pressing the Sign In With Google button triggers the consent and sign-in moment:

Alt text

Automatic sign-in

Automatic sign-in is only an option if a user has previously granted consent. If you enable Automatic sign-in, returning users are shown a popup dialog for a short period of time to enable them to cancel the sign-in process before the ID token is shared with your app. First time visitors, or users who have revoked their previous consent to share their profile with your app will instead be presented with the One Tap dialog.

Alt text

User sign-in to your site

After user consent, a JSON Web Token (JWT) credential containing the user's name, email and profile picture is shared using either a JavaScript callback handler or a redirect to your backend service.

You'll manage per user session state for sign-in to your site.

User sign-in status to their Google Account and your app are independent of each other, except during the sign-in moment itself when you know that the user has successfully authenticated and is signed into their Google Account. Users may remain signed-in, sign-out, or switch to a different Google Account while maintaining an active, signed-in session on your website.

From here, you might:

  • choose to simply allow the verified user to access pages on your site,
  • use the profile information to check for duplicate accounts, associating the user with an existing account, or use the profile information to pre-populate and create a new account on your platform,
  • allow other activities where a verified user account is necessary.

Users may globally disable One Tap and Automatic sign-in, or revoke consent to share their account profile by visiting myaccount.google.com at any time.