Supabase Authentication

This guide covers how to set up authentication in Supabase, including basic configuration and Google OAuth integration.

Basics

Follow these steps to configure basic authentication settings in Supabase.
1

Navigate to URL Configuration

Go to Authentication ⇒ URL Configuration in your Supabase dashboard.
Supabase URL Configuration
2

Add URL

Click “Add Url” to add a new redirect URL.
3

Configure Redirect URL

Add your URL for the redirect to ensure proper authentication flow.

Google Authentication

Set up Google OAuth authentication for your Supabase project.

Step 1: Initial Supabase Config

1

Enable Google Provider

  1. Go to Authentication ⇒ Providers
  2. Enable Sign in with Google
Enable Google Sign In

Step 2: Configure OAuth Screen

1

Access Google Cloud Console

  1. Get the Client ID and Client Secret from Google Cloud Console
  2. First create a new project
Create New Project
2

Navigate to APIs & Services

Click APIs & Services in the Google Cloud Console.
APIs & Services
3

Configure Consent Screen

Configure the OAuth consent screen for your application.
Configure Consent Screen
4

Set Authorized Domain

Fill out the necessary information, including the Authorized domain 1 with the Callback URL (for OAuth) as shown in the image.
Authorized Domain Configuration
5

Complete Configuration

Complete the configuration process using the details specific to your application, ensuring all required fields are accurately filled.

Step 3: Create OAuth Keys

1

Create OAuth Credentials

Click Credentials ⇒ + Create Credentials
Create OAuth Credentials
2

Select OAuth Client ID

Choose OAuth Client ID from the credentials options.
OAuth Client ID
3

Choose Application Type

Select Application Type: Web application
Web Application Type
4

Configure Redirect URI

Add redirect URI from Supabase. Get the Callback URL from Supabase and insert it into Google’s configuration.
Supabase Callback URL
Add Redirect URI
5

Get Credentials

Get the resulting Client ID and Client Secret and add them to Supabase.
Google Client ID and Secret
Supabase Google Configuration
Make sure to test your authentication flow thoroughly after configuration to ensure everything works correctly across different environments.