Connect Your Client to Google

To connect your Auth0 client to Google and Google Apps, you will need to generate a Client ID and Client Secret in a Google project, copy these keys into your Auth0 settings, and enable the Connection.

1. Access the Google API Manager

While logged in to your Google account, go to the API Manager.

2. Create Your New App

To create your new app, navigate to Credentials using the left-hand menu:

While you are on the Credentials page, click on Create a project.

In the dialog box that appears, provide a Project name, answer Google's email- and privacy-related questions, and click Create:

Google will take a moment to create your project. When the process completes, Google will prompt you to create the credentials you need.

Click on Create credentials to display a pop-up menu listing the types of credentials you can create. Select the OAuth client ID option.

At this point, Google will display a warning banner that says, "To create an OAuth client ID, you must first set a product name on the consent screen." Click Configure consent screen to begin this process.

Provide a Product Name that will be shown to users when they log in through Google.

Click Save:

4. Create your Client Id and Client Secret

At this point, you will be prompted to provide additional information about your app.

Select Web application, and provide a name for your app.

Under Restrictions, enter the following information:

  • Authorized JavaScript origins: https://YOUR_NAMESPACE
  • Authorized redirect URI: https://YOUR_NAMESPACE/login/callback

Click Create. Your Client Id and Client Secret will be displayed:

Save your Client Id and Client Secret to enter into the connection settings in Auth0 in Step 7.

6. Enable the Admin SDK Service

If you are planning to connect to Google Apps enterprise domains, you will need to enable the Admin SDK service.

Navigate to the Library page of the API Manager.

Select Admin SDK from the list of APIs:

On the Admin SDK page, click Enable.

7. Enable the Connection

Login to the Auth0 Dashboard and select Connections > Social in the left navigation.

Select the connection with the Google logo to access this connection's Settings page:

Select each of your existing Auth0 Clients for which you want to enable this connection.

Click Save.

8. Copy your Client Id and Client Secret into Auth0

Copy the Client Id and Client Secret from the Credentials page of your project in the Google API Manager into the fields on this page on Auth0.

Select the Permissions for each of the features you want to allow your app to access.

Click Save.

9. Test your connection

Go back to the Connections > Social section of the Auth0 dashboard.

If you have configured your connection correctly, you will see a Try icon next to the Google logo:

Click Try.

Click Allow in the permissions pop-up screen:

If you have configured everything correctly, you will see the It works!!! page: