Cursor·Fix

Fix: Supabase Google OAuth Login Failing

Quick Answer

The #1 cause is a redirect URI mismatch. In Google Cloud Console > Credentials > your OAuth client, add your exact Supabase callback URL: https://[your-project-ref].supabase.co/auth/v1/callback

Quick Fix Summary

IssueGoogle OAuth not working
Fastest fixGet the correct redirect URI
Use this page ifError: redirect_uri_mismatch

Symptoms

  • !Error: redirect_uri_mismatch
  • !Google login popup closes without logging in
  • !OAuth returns 'access_denied' error
  • !Login works locally but fails in production

Step-by-Step Fix

1

Get the correct redirect URI

Go to Supabase Dashboard > Authentication > Providers > Google. Copy the 'Callback URL' shown there. It looks like: https://abcdefgh.supabase.co/auth/v1/callback

2

Add to Google Cloud Console

Go to console.cloud.google.com > APIs & Services > Credentials > your OAuth 2.0 Client. Under 'Authorized redirect URIs', paste the exact Supabase callback URL. No trailing slash.

3

Configure OAuth consent screen

In Google Cloud Console > OAuth consent screen, make sure the app is set to 'External' (not Internal unless you're using Google Workspace). Add required scopes: email and profile.

4

Add client ID and secret to Supabase

Copy the Client ID and Client Secret from Google Cloud Console. Paste them into Supabase Dashboard > Authentication > Providers > Google > Client ID and Client Secret.

Frequently Asked Questions

You probably only added localhost as a redirect URI in Google Cloud Console. You need to add both: http://localhost:54321/auth/v1/callback (local) AND https://[project-ref].supabase.co/auth/v1/callback (production).

For testing, 'Testing' mode works. For production with more than 100 users, you need to submit for Google verification.

Related

Weekly Signals

Get the next fix, switch, or warning before it hits your build.

Join builders getting the community signals, fix patterns, and tool shifts that matter before they show up everywhere else.

Follow the signals →