This is a guide to setting up Google authentication with Supabase.

Please follow the Supabase Official Documentation for more information.

To authenticate with Google, you need to create a Google Cloud Platform project and configure your app in the Google Cloud Console.

1

Create a Google Cloud Platform Project

  1. Go to the Google Cloud Console.
  2. Click on the “Select a project” dropdown in the top navigation bar.
  3. Click on the “New Project” button to create a new project.

  1. Enter a name for your project and click on the “Create” button.
2

Create OAuth consent screen

  1. Go to the “OAuth consent screen” page.
  2. Select the “External” user type.
  3. Click on the “Create” button.

  1. Fill in the required fields and click on the “Save and continue” button.
3

Supabase Configuration

  1. Go to the Supabase Dashboard.
  2. Select your project and go to the “Settings” tab.
  3. Click on the “Authentication” tab, then the “Providers” tab.
  4. Select Google.
  5. Toggle “Enable”.
  6. Copy your Callback URL for the next step.

4

Create OAuth Client ID's

  1. Return to the Google Cloud Console.
  2. Go to the OAuth 2.0 Client IDs page.
  3. Create a new OAuth 2.0 Client ID, selecting your application type.
  4. For Web Applications, add the Callback URL you copied from Supabase in the “Authorized redirect URIs” input.

After creation, you’ll see your OAuth Client ID’s:

5

Update tokens in Supabase

  1. Copy the Client ID and Client Secret (if created web Client ID) from Google Cloud Console.
  2. Paste them in the Google provider configuration in Supabase.
  3. Add the Client ID’s in the “Authorized Client IDs” input.
  4. Save the configuration.

6

Update Client ID in your app

Replace YOUR_GOOGLE_CLIENT_ID in the template with the Client ID you created.