Firebase: “This domain is not authorized for OAuth operations”

Short answer

Firebase only allows sign-in from domains on the Authorized domains list. Fix: Add your domain; Add localhost for development if needed; Retry in a fresh tab.

You'll see:
  • auth/unauthorized-domain
  • Google sign-in popup closes immediately on your deployed site

Why does this happen?

Firebase only allows sign-in from domains on the Authorized domains list. Your new hosting domain isn't on it. Projects created after April 28, 2025 also don't include localhost by default.

How do you fix it?

  1. Add your domain

    Firebase console → Authentication → Settings → Authorized domains → Add domain. Add the bare domain (yourdomain.com), plus any preview domain you use.

  2. Add localhost for development if needed

  3. Retry in a fresh tab

Common with:

Related fixes