Scroll down to the "Your apps" section and copy the configuration snippet for your web app. Update your Code
Scroll down until you find the section labeled
In the Firebase Console, go to Authentication > Settings > Authorized Domains. Ensure your domain (e.g., localhost or your production URL) is listed there.
✅ Always configure authDomain in config AND in authorized domains ✅ Use signInWithPopup() during development ✅ Set up custom domains before implementing redirect flows ✅ For multi-tenant apps, configure tenant-specific domains properly Firebase Error -auth Auth-domain-config-required-
// DANGEROUS - This does not exist and should not be attempted. firebase.initializeApp(config, bypassDomainCheck: true );
Navigate to the Firebase Console .
What not to do:
| Scenario | Solution | | :--- | :--- | | localhost:3000 error | Ensure localhost is in Authorized Domains (it usually is by default; check if accidentally deleted). | | 192.168.1.5 (LAN testing) | Add 192.168.1.5 to Authorized Domains. Note: This is less secure for production. | | my-app.netlify.app | Add my-app.netlify.app . | | custom-domain.com | Add custom-domain.com plus the non-www version ( www.custom-domain.com ) if used. | | Works on Chrome, fails on Safari | Check Safari's "Prevent cross-site tracking" settings. Try signInWithPopup instead of redirect . |
Ensure your initialization block looks like the example below. The authDomain usually follows the pattern [PROJECT-ID].firebaseapp.com . javascript
There are several reasons why you might encounter the "auth-domain-config-required" error: Scroll down to the "Your apps" section and
file or a backend template), verify that the variable names match exactly and that authDomain
field, or the field is incorrectly defined. This parameter is essential for Firebase Authentication to handle redirects and OAuth operations. How to Fix It