VibeFix

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 ↓

Published by Yosef Dabian, founder of VibeFix

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

This applies to apps that use Firebase Authentication, including apps made with AI builders.

Fixed in your code, then tested live. Did the steps and it still fails? Our AI agent finds why on your live app with a free check, usually in under 10 minutes, then can fix it in your code.

Free. No account needed. It usually takes under 10 minutes.

Want it fixed? For any app whose code is on GitHub, including Lovable, our AI agent fixes it in your code for $29 and tests your live app again. If we can't complete your re-check, you get your money back.

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

How to fix it

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. If people land back on the login page after choosing their Google account: the app uses signInWithRedirect on a domain different from authDomain, 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.

  1. Open your Firebase project in the Firebase console and go to Security, then Authentication.
  2. Open the Sign-in method tab.
  3. Select Google, turn it on, and save.
  4. Make sure your live domain is on the authorized domains list. The Firebase unauthorized domain guide shows how.
  5. Open your live site in a private window and sign in with Google.
  6. 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

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