Firebase auth/unauthorized-domain
Firebase Auth rejects OAuth sign-in from domains that aren't in the project's authorized domains list. Add your custom domain (and preview domains you use) in Authentication settings.
Cause: The app's domain isn't in Firebase Auth's authorized domains.
How to fix it
- Open Firebase console > Authentication > Settings > Authorized domains.
- Add your production domain (e.g.
app.example.com). - Add any preview domains you test on.
- Update OAuth provider settings if you use a custom auth domain.
Example
Illustrative example, not from a customer project.
Authorized domains
localhost
myapp.firebaseapp.com
+ app.example.com
FAQ
Why does it work on localhost?
localhost is authorized by default.
Do I need to redeploy?
No, the change is in Firebase settings.
Get a $149 diagnosis See pricing Still exposed or still logged out? Get an auth & database security fix (Supabase, Firebase).
- Fixed, or we keep working free until it is (within the written scope).
- A human reviews every fix before it ships.
- read-only access; fixes arrive as pull requests you merge
- Your $149 diagnosis is credited in full toward any paid job.