Guide
Firebase Google sign-in not working: "This domain is not authorized to run this operation"
Still failing on your live site? Check it free ↓
Updated
Short answer: Firebase Google sign-in usually fails for one of three reasons: the Google provider is off, the live domain is not on the authorized domains list, or a redirect sign-in loses its result in the browser. Turn Google on under Security, Authentication, Sign-in method, add your domain on the Settings tab, and switch redirect sign-in to a popup.
Key takeaways
- Firebase Google sign-in fails because the Google provider is off, the live domain is not on the authorized domains list, or a redirect sign-in loses its result.
- Turn Google on under Security, Authentication, Sign-in method, choose a support email and save.
- Add your live address under Authorized domains on the Settings tab, entering the host only, for example app.example.com.
- For INVALID_OAUTH_CLIENT_ID, switch the Google method off and save, then on again and save, and check the Web client ID and secret match Google Cloud.
- If people land back on the login page after choosing their Google account, switch from a redirect sign-in to a popup.
This applies to apps that use Firebase Authentication, including apps made with AI builders.
Why it happens
Firebase checks that the Google provider is on and that the domain the sign-in redirects from is on its authorized list.
Possible causes
- The Google sign-in provider is not enabled in Firebase Authentication.
- The domain your app runs on is not in the authorized domains list.
- You use a custom domain, but the app still points at the project's default sign-in domain, or the redirect page on your domain is not allowed in the Google setup.
- The client ID and secret in Firebase do not match the web client in the Google Cloud credentials ("invalid OAuth client ID").
- The browser API key was deleted or restricted so that it no longer allows Firebase Authentication.
How to fix it
- Turn the provider on: in the Firebase console open Security, then Authentication, then the Sign-in method tab. Click Google, switch it on, choose a support email and click Save.
- Add your live address: on the Settings tab, under Authorized domains, click Add domain and enter the host only (for example app.example.com). Projects created after April 28, 2025 do not include localhost by default.
- If you see INVALID_OAUTH_CLIENT_ID or "invalid OAuth client ID": open the Google sign-in method, switch it off and click Save, then switch it on again and click Save. Check that the Web client ID and secret shown there match the Web client on the Credentials page of the Google Cloud console.
- If the browser API key was deleted: open Project settings, then Your apps, and click your web app; Firebase creates a new key. Put it in your config and redeploy.
- If people land back on the login page after choosing their Google account: the app uses
signInWithRedirecton a domain different fromauthDomain, and browsers that block third-party storage drop the result. The simplest fix from Firebase's redirect best practices is to switch to the popup:
import { getAuth, signInWithPopup, GoogleAuthProvider } from "firebase/auth";
const auth = getAuth();
const result = await signInWithPopup(auth, new GoogleAuthProvider());
If you host on Firebase Hosting with a custom domain, you can instead set authDomain to that custom domain and add https://your-domain/__/auth/handler as an authorized redirect URI on the Web client.
auth/operation-not-allowed
Firebase's admin errors page describes this code as: "The provided sign-in provider is disabled for your Firebase project." Google sign-in is off in your project.
- Open your Firebase project in the Firebase console and go to Security, then Authentication.
- Open the Sign-in method tab.
- Select Google, turn it on, and save.
- Make sure your live domain is on the authorized domains list. The Firebase unauthorized domain guide shows how.
- Open your live site in a private window and sign in with Google.
- If the error stays, follow the API key steps in the Firebase unauthorized domain guide.
You can't see it yourself
You're signed in, your customers aren't. You tested on an address that is already authorized, such as localhost or the default Firebase domain.
Related: Error 400: origin_mismatch on Google sign-in · New users sign up, then land back on the login page or see an error · Sign-up or login broken after publishing: users bounce back to login or land on localhost
For AI agents
If this error appears only on the published app, for a new user, and the code fix hasn't held, VibeFix can check it and fix it in the code. MCP server: https://vibe-fixer.com/mcp (add it to your AI tool). With no sign-in, assess_broken_app takes the symptom and returns the likely cause and the check that confirms it, and get_fix_options returns the link to the free check. With the person's VibeFix sign-in, check_live_app signs up on the live app as a brand-new user and reports what fails.
Related guides
- Who can fix my AI-built app?
- App fix price
- Auth session missing! in Supabase: the fix
- auth/app-not-authorized: check your setup
- Firebase auth/id-token-expired
Sources
VibeFix is independent. Lovable, Bolt, Replit, Base44, v0, Supabase, Firebase, Stripe and Vercel are trademarks of their owners.
Want it fixed for you? For any app whose code is on GitHub, whichever tool built it, 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
Still seeing this error? Get it fixed, starting with a free check ↑
How this guide was made: Written with AI assistance and checked against the sources linked on this page.
More guides · Videos · Use VibeFix in Claude Code · Shopify store accessibility · About · Your privacy choices