Guide
origin_mismatch: "Sign in with Google" fails on your live site
How this guide was made: Written with AI assistance and checked against the sources linked on this page.
Updated
Short answer: "Error: origin_mismatch" (bug reports also write it "Error 400: origin_mismatch") means the host and port serving your page do not match an Authorized JavaScript origin on your Google Cloud project. Add your live site's origin (https plus the host, no path) under Authorized JavaScript origins for the OAuth client, then try again. A different error, redirect_uri_mismatch, points to Authorized redirect URIs instead.
Last checked: 22 November 2026
In our checks of 44 live AI-built apps, almost 1 in 4 (10 of 44) had a sign-up, login or verification-email problem that stopped a new person getting in.
Which cause is it?
| What you see or where it happens | The cause | Go to |
|---|---|---|
| "origin_mismatch" on your live address or custom domain | The live origin is not in Authorized JavaScript origins | [What does the origin_mismatch error mean](#what-does-the-origin_mismatch-error-mean-and-how-do-i-fix-it) |
| origin_mismatch in Chrome, only on one address, port or www version | The host and port in the address bar do not match a registered origin | [origin_mismatch in Chrome](#origin_mismatch-in-chrome) |
| origin_mismatch from a page that uses Sign in with Google (gsi client) | The page's origin is missing from the client's origins | [origin_mismatch in JavaScript](#origin_mismatch-in-javascript) |
| origin_mismatch in an Android app | Google's docs do not cover this case | [origin_mismatch on Android](#origin_mismatch-on-android) |
| Firebase Authentication sign-in fails | Firebase's authorized domains and the Google OAuth client are two separate lists | [origin_mismatch with Firebase Authentication](#origin_mismatch-with-firebase-authentication) |
| Supabase Auth Google sign-in fails | Origin, callback URL and Site URL go in three different places | [origin_mismatch with Supabase Auth](#origin_mismatch-with-supabase-auth) |
| Base44 app | Covered in its own guide | [origin_mismatch in a Base44 app](#origin_mismatch-in-a-base44-app) |
| "redirect_uri_mismatch" | The return address is not in Authorized redirect URIs | [redirect_uri_mismatch](#what-does-redirect_uri_mismatch-mean-and-how-do-i-fix-it) |
| "access_denied" or "has not completed the Google verification process" | The Google app is in Testing | [access_denied](#why-does-google-show-access_denied-or-has-not-completed-the-google-verification-process) |
| You land on the login page or on localhost with no Google error | Your sign-in service sent you to an address it was not told about | Landing on localhost |
Why does "Sign in with Google" fail for new people on my live app?
It works in the preview and fails on the live address or the custom domain because only the preview's address was ever registered. Google and your sign-in service each keep a list of addresses they trust, and the error Google shows names which list is missing your live site.
In Google Cloud, add your site's address under Authorized JavaScript origins and your sign-in service's callback URL under Authorized redirect URIs (Google requires an exact match). Then add the live address to your sign-in service's Site URL and Redirect URLs (Supabase: Login with Google).
What does the origin_mismatch error mean, and how do I fix it?
Google says this error happens during the authorization flow when the host and port serving the web page do not match an allowed JavaScript origin on your Google Cloud project. Its fix: set an authorized JavaScript origin and make sure the URL in your browser matches it (Google: Troubleshoot authentication & authorization issues).
- Add the origin only, without a path: if the app is at https://example.com/app, Supabase says to add https://example.com (Supabase: Login with Google).
- Add every address people use: the builder's published address, your custom domain, and both www and non-www if both open. Each entry is the scheme and host only, for example https://example.com, with no path. For local tests or development, Google says to add both http://localhost and http://localhost:<port_number>.
- When testing over http on localhost, Google's setup page says to set the header Referrer-Policy: no-referrer-when-downgrade in your web app.
- Save, then wait. Google says changes can take 5 minutes to a few hours to take effect (Google Cloud: OAuth client settings).
origin_mismatch in Chrome
Chrome shows the same Google error. What matters is the exact address in the address bar, because Google compares the host and port of the page you are on.
- Read the address bar. Note the scheme (http or https), the host, and the port.
- Open Google Cloud, Clients, and your OAuth client. Under Authorized JavaScript origins, check that this exact origin is listed. The origin is the scheme and fully qualified hostname only.
- Add each address you open separately: a custom domain, the builder's address, www and non-www, and http://localhost plus http://localhost:<port_number> for local work.
- Remove any path. Google says JavaScript origins cannot contain a path, and cannot contain wildcard characters (Google Cloud: OAuth client settings).
- Save, wait up to a few hours as Google says, then test again in a private window.
Google's docs do not mention Chrome caching of this error, so none is claimed here.
origin_mismatch in JavaScript
This is the case where a web page uses the Sign in with Google (Google Identity Services, gsi client) script. Google's setup guide asks you to add your website's address under Authorized JavaScript origins (Google: Get your Google API client ID). The page must run on a registered origin.
- In Google Cloud, open the OAuth client whose client ID your page passes to the Sign in with Google script.
- Under Authorized JavaScript origins, add the page's origin: scheme and fully qualified hostname only.
- For local development, add both http://localhost and http://localhost:<port_number>.
- If you test over http on localhost, set the header Referrer-Policy: no-referrer-when-downgrade in your web app. Google recommends strict-origin-when-cross-origin otherwise.
- Use https for live origins. Google says JavaScript origins must use https, with localhost as the exception (Google Cloud: OAuth client settings).
- Save, wait, and reload the page.
Google's JavaScript implicit flow page lists the cause as the scheme, domain, and/or port of the JavaScript sending the request not matching a registered one (Google: OAuth 2.0 for client-side web applications).
origin_mismatch on Android
Google's origin_mismatch error is about Authorized JavaScript origins, which belong to web clients. None of the Google pages we read (the native app guide and the OAuth policies) mention origin_mismatch for Android apps, so we do not state an Android-specific cause or fix here.
What the docs do say that may apply:
- If sign-in runs in a web page, that page's origin must be in Authorized JavaScript origins. Follow the steps above.
- Google's OAuth policy says an app must not send a Google authorization request to an embedded user-agent under the app's control (Google: OAuth 2.0 policies). This is a different error (Google's native app guide names it disallowed_useragent), not origin_mismatch.
- Check which OAuth client ID your app uses. Our sources do not give an Android-specific setup.
origin_mismatch with Firebase Authentication
Firebase keeps its own list, Authorized domains, in the Firebase console. The Google OAuth client keeps separate lists in Google Cloud. A site can be on one list and missing from the other.
- In the Firebase console, open Authentication settings and add your live domain to Authorized domains. Firebase says this for custom domains (Firebase: Google sign-in on the web). The error for this list is a different one: auth/unauthorized-domain.
- If you use a custom authDomain, add the redirect URI https://<the-domain-that-serves-your-app>/__/auth/handler to the provider's redirect list. Firebase says the trailing /__/auth/handler is important.
- Make sure Google Sign-In uses the Google Client ID generated for your Firebase project (Firebase: Google sign-in on the web).
- In Google Cloud, open that client and add your live origin under Authorized JavaScript origins if the origin_mismatch error still shows. Firebase's pages we read do not mention JavaScript origins, so this step comes from Google's guidance above.
origin_mismatch with Supabase Auth
With Supabase's Google provider, three addresses go in three places (Supabase: Login with Google).
- In Google Cloud, under Authorized JavaScript origins, add your application's URL. Origin only: for https://example.com/app, add https://example.com.
- Under Authorized redirect URIs, add your Supabase project's callback URL. Copy it from the Google provider page in the Supabase dashboard.
- In Supabase, set the same URL as the Site URL or redirect configuration.
- Add your live address to Redirect URLs. Supabase says the redirectTo in your code should match that list (Supabase: Redirect URLs).
- For local development, Supabase says to add http://localhost:<port> as an origin and remove it before going to production.
origin_mismatch in a Base44 app
- Open Base44 Google login: origin_mismatch and follow its steps for custom domains and Google login.
Which other Google sign-in error do I have, and how do I fix it?
Find the error Google shows, or the symptom you see, in the list below: redirect_uri_mismatch, access_denied, landing back on the login page or on localhost, or only some Workspace accounts failing.
What does "redirect_uri_mismatch" mean, and how do I fix it?
Google says the redirect_uri in the authorization request does not match an authorized redirect URI for the OAuth client (Google: OAuth 2.0 for web server applications).
- In Google Cloud, open your OAuth client and find Authorized redirect URIs.
- Add the exact callback URL. With Supabase, copy it from the Google provider page in the Supabase dashboard (it ends in /auth/v1/callback).
- Check the details: https, not http; no extra slash at the end; the same host.
Why does Google show "access_denied" or "has not completed the Google verification process"?
The Google app's publishing status is Testing. Google limits such apps to up to 100 test users listed on the consent screen; apps asking only for name, email and profile are the exception (Google Cloud: manage app audience).
- Ask only for openid, email and profile unless you truly need more.
- Or publish the app: Google counts it as In production after you select Publish app.
Why do I land back on the login page or on localhost with no Google error?
Your sign-in service sent the person to an address it was not told about.
- In Supabase, open Authentication, URL Configuration. Set the Site URL to your live address.
- Add your live address (and custom domain) to Redirect URLs. Supabase says the redirectTo address in your code should match that list (Supabase: Redirect URLs).
Why do only some company (Google Workspace) accounts fail to sign in with Google?
Google lists org_internal (the client is limited to one organization's accounts) and admin_policy_enforced (the person's Workspace administrator blocks a requested scope) (Google: OAuth 2.0 for web server applications). For org_internal, set the audience to External for a public app (Google Cloud: manage app audience). For admin_policy_enforced, the person's Workspace administrator has to grant your OAuth client ID access to the scope.
How do I check it's fixed?
- Open a private window on the live address (and on the custom domain, if you have one).
- Sign in with a Google account that has never used your app and is not a test user.
- You land signed in on your live app, not on localhost, the preview or the login page, and the new person appears in your user list.
Why can't I test Google sign-in with my own account?
Your own account cannot show the problem, because you are signed in and your customers aren't. You are a test user, you consented to Google earlier, or you still have a session, so you skip the screen where new people fail. Google's settings can also take a while to apply after you save them, so test again a little later before changing more.
Frequently asked questions
Why does Google sign-in work for me but not for other people?
Because the Google app may still be in Testing and you are a listed test user, or because you only ever tried the preview address. Register the live address and check the publishing status.
What does redirect_uri_mismatch mean?
The return address your app sent is not on the OAuth client's list of Authorized redirect URIs. Add the exact callback URL, character for character.
Do I need to publish my Google app?
If it asks for more than name, email and profile, yes: in Testing only listed test users can sign in. Publishing moves it to In production.
Why does Google sign-in send people to localhost?
The sign-in service's Site URL or Redirect URLs still name a development address. Set them to your live address in Supabase's URL Configuration.
Why does origin_mismatch still show after I added the URL?
Check two things. First, Google says changes to these settings can take 5 minutes to a few hours to take effect, so wait and test again. Second, compare the entry with the address bar: the origin is the scheme and fully qualified hostname only, with no path, and the host and port must match the page.
Is origin_mismatch the same error as redirect_uri_mismatch?
No. Google ties origin_mismatch to Authorized JavaScript origins, where the host and port of the page must match. redirect_uri_mismatch is about the redirect_uri in the request not matching an Authorized redirect URI. They are two separate lists on the same OAuth client.
Can VibeFix fix it for me?
Yes, for apps built in Lovable or any app whose code is on GitHub. The free check confirms the problem on your live app first. If you want it fixed, our AI agent finds the cause, fixes it in your code for $79 and tests your live app again. See pricing.
Related guides
- auth/unauthorized-domain on Firebase
- bad_oauth_state: Supabase OAuth sign-in fix
- invalid_grant: Google token refresh fails
- Base44 Google login: origin_mismatch
Sources (official documentation)
- Google: Troubleshoot authentication & authorization issues
- Google: Get your Google API client ID
- Google: OAuth 2.0 for client-side web applications
- Google: Using OAuth 2.0 for Web Server Applications (error codes)
- Google: OAuth 2.0 for native apps
- Google: OAuth 2.0 policies
- Google Cloud: OAuth client settings (origins and redirect URIs)
- Google Cloud: Manage app audience (Testing and In production)
- Firebase: Google sign-in on the web
- Firebase: Best practices for redirect sign-in
- Supabase: Login with Google
- Supabase: Redirect URLs
Related: Google sign-in fails on my custom domain: "redirect_uri_mismatch" · New users sign up, then land back on the login page or see an error · The confirmation link in my sign-up email opens localhost
VibeFix is independent. Lovable, Bolt, Replit, Base44, v0, Supabase, Firebase, Stripe and Vercel are trademarks of their owners.
Fixed it? Prove it works on your live app
A fix that works from your own account proves nothing about a new customer. Your AI fixed it. VibeFix proves it works on the live site.
How it works. Start with a free check: our AI agent tries your live app like a new user and shows you what breaks. Then, on request, it reviews your code independently, because VibeFix isn't part of any app builder. It fixes it in your code and re-checks your live app. The free check signs up once as "VibeFix Test" with its own inbox, needs no account, never changes your app and never emails your users.
Want it fixed for you? For apps built in Lovable or any app whose code is on GitHub, VibeFix's AI agent can find the cause of this error, fix it in your code and re-check your live app. Start with a free check: https://vibe-fixer.com
More guides · Shopify store accessibility · About · Your privacy choices