Error 400: redirect_uri_mismatch (Sign in with Google)

Google sign-in shows "Error 400: redirect_uri_mismatch"? The callback URL in Google Cloud must exactly match the one your app or Supabase uses.

Last edited October 17, 2026

On this page

What it means in plain English

Google only sends users back to addresses you've pre-approved. The address your app asked for isn't on that list, letter-for-letter.

Find a fix pack

Checklists and prompts for Supabase security, Stripe payments and deploys. Each pack is $24, or $49 for all three.

Likely causes

  • The Supabase callback URL (https://<project-ref>.supabase.co/auth/v1/callback) isn't in Google's Authorized redirect URIs.
  • Mismatch in http vs https, www, capital letters or a trailing slash; Google requires an exact match.
  • You're using a custom auth domain or a different OAuth client ID in production.

How to fix it, step by step

  1. Supabase → Authentication → Providers → Google: copy the Callback URL shown there.
  2. Google Cloud Console → Google Auth Platform → Clients → your Web client.
  3. Under Authorized redirect URIs, paste the Supabase callback URL exactly. Under Authorized JavaScript origins, add your site, e.g. https://yourapp.com.
  4. Save (Google changes can take a few minutes).
  5. Make sure the Client ID and Secret in Supabase match this same Google client.
  6. After Google, Supabase sends users to your app; that must also be allowed (see the localhost redirect page).

How to check it worked

  • Click 'Sign in with Google' on the live site; you should reach the consent screen and return signed in.
  • No 400 error page.

On a Lovable app, this shows up after you connect a custom domain and Google still has the old origin. See Lovable Google sign-in fails on a custom domain.

Sources

Tool to consider: Supabase.

Find a fix pack

Checklists and prompts for Supabase security, Stripe payments and deploys. Each pack is $24, or $49 for all three.