Fix guide · updated 2026-11-13
Google login "Error 400: redirect_uri_mismatch": the fix for Supabase and Lovable apps
Access blocked: This app's request is invalid. Error 400: redirect_uri_mismatch
You click Sign in with Google and Google stops you with Access blocked: This app's request is invalid, and under it Error 400: redirect_uri_mismatch. Your users see the same page. It always means one thing: the address your app asked Google to send people back to is not on the list your Google OAuth client allows. Google only accepts an exact match, so the fix is to put that exact address on the list.
What the error means
When someone signs in with Google, your app sends them to Google with a redirect_uri: the address Google should send them back to afterwards. Google compares it with the Authorized redirect URIs saved on your OAuth client and refuses if it isn't there exactly. Google's own docs say the scheme (http or https), letter case and a trailing slash must all match.
To see the address Google received, click see error details on the error page. The line redirect_uri=… is the exact value to add.
In an app that uses Supabase for login, that address is not your app. Google sends users to Supabase first, at https://<your-project-ref>.supabase.co/auth/v1/callback. Supabase signs them in, then sends them on to your app. So Google needs Supabase's address, and the most common mistake is adding your app's address (https://yourapp.lovable.app, https://yourapp.com) instead.
- Your app uses your own Supabase project (Lovable connected to Supabase, Bolt, Cursor, v0, Next.js): see section 1.
- Your app runs on Lovable Cloud, Lovable's built-in backend: see section 2.
- It worked, then broke after a domain change: see section 3.
- The error code is different (
origin_mismatch,invalid_client,access_denied): see section 4.
1. Supabase apps: add Supabase's callback address in Google
- In Supabase, open Authentication → Sign In / Providers → Google (just Providers in older dashboards). Copy the callback URL shown there. It looks like
https://abcdefghijklmnopqrst.supabase.co/auth/v1/callback. - In Google Cloud, open Google Auth Platform → Clients (in older menus, APIs & Services → Credentials). Click the OAuth client whose Client ID is the one in your Supabase Google settings.
- Under Authorized redirect URIs, click Add URI and paste the callback URL exactly as you copied it:
https, no slash at the end, nothing added. Click Save. - Under Authorized JavaScript origins, check that your app's address is there too, as an origin only:
https://yourapp.com, no path. Supabase's setup guide asks for both lists. - Try again in a private window. Google warns that a change can take from five minutes to a few hours to apply. If it still fails right away, wait before changing anything else.
Still failing after the wait? It is almost always one of these:
- You edited a different client. A Google Cloud project can hold several OAuth clients, and you may have more than one project. Compare the Client ID in Supabase with the one on the client page you edited. They must be the same.
- Wrong client type. The client must be a Web application. Android, iOS and desktop clients have no redirect list, and a sign-in that goes through Supabase needs one.
- A near miss.
httpinstead ofhttps, a slash at the end, a typo in the project ref, or your app's address instead of Supabase's. Google allows no wildcards (*), so every address goes in whole. - Testing locally with the Supabase CLI. The callback is then
http://127.0.0.1:54321/auth/v1/callback, and it needs its own line.
2. Lovable Cloud apps
On Lovable's built-in backend, Google sign-in is Managed by Lovable by default: Lovable runs the Google client, and you set nothing up in Google Cloud. The error comes up when you switched to Your own credentials:
- In Lovable, open More → Users → Settings → Google. Lovable lists the redirect addresses your app can use: one for your
lovable.appaddress, and one for each custom domain. - Add every one you use to Authorized redirect URIs on your Google client, copied exactly. Lovable's docs say scheme, domain, path and trailing slash all matter.
- Back in Lovable, select the addresses you added and click Save. Lovable only sends users back through the addresses you select there.
Don't need your own branding on the Google consent screen? Switching back to Managed by Lovable removes the Google Cloud setup completely.
3. It worked, then broke after a domain change
- Supabase custom domain (like
api.yourapp.com): sign-ins now announce a new callback,https://api.yourapp.com/auth/v1/callback. Supabase's docs say to add it in Google in addition to the original….supabase.coone, not instead of it. The same goes for a vanity subdomain likeyourbrand.supabase.co. - A new custom domain on Lovable Cloud, with your own credentials: add its redirect address in Google and select it in Lovable (section 2).
- A new address for your app (a new domain, or a move from Lovable to Vercel or Netlify) with Supabase login: Google's redirect list doesn't change, because it still points at Supabase. Add the new address to Authorized JavaScript origins in Google, and to Supabase's Authentication → URL Configuration, or users come back to the wrong place.
4. Similar Google errors
Error 400: origin_mismatch, or The given origin is not allowed for the given client ID in the browser console: the Google button or One Tap checks your app's address against Authorized JavaScript origins instead. Add it there, as an origin only (https://yourapp.com).Error 401: invalid_client(The OAuth client was not found): the Client ID in Supabase or Lovable is wrong, or that client was deleted. Copy it again from the client page in Google Cloud.Error 403: access_deniedwhile your Google app is in testing: only the test users listed under Google Auth Platform → Audience can sign in. Add them, or publish the app.Unsupported provider: provider is not enabledon a page of JSON, before any Google page: Supabase stops before asking Google, because Google sign-in is off, or saved without its secret, in the project your app uses. See Supabase "Unsupported provider: provider is not enabled".
Still stuck?
If Google now lets users through but they land on {"error":"requested path is invalid"} or on localhost, the Google side is fixed and the problem is in Supabase's URL settings: see Supabase "requested path is invalid" and Supabase login redirecting to localhost. Supabase → Authentication → Logs shows each sign-in attempt and where it went.
Other Supabase problems? See Supabase fixes.