This Firebase Authentication error occurs when your app tries to use a dynamic link domain that hasn't been configured or authorized for your Firebase project. The fix involves configuring dynamic link domains in the Firebase Console and updating your app's configuration.
The "auth/invalid-dynamic-link-domain" error in Firebase Authentication indicates that your application is attempting to use a dynamic link domain that hasn't been properly configured for your Firebase project. Dynamic links are used in Firebase Authentication for email actions (password reset, email verification) and other scenarios where users need to be redirected back to your app. When Firebase generates a dynamic link for authentication purposes, it needs to know which domain to use. If you specify a domain in your `ActionCodeSettings` that hasn't been configured in the Firebase Console, or if you're using the deprecated `dynamicLinkDomain` parameter, Firebase will throw this error. This error commonly appears when: 1. You've recently set up a new Firebase project and haven't configured dynamic links 2. You're migrating from an old Firebase project and the domain configuration didn't transfer 3. You're using a custom domain that hasn't been added to your Firebase project 4. You're using the deprecated `dynamicLinkDomain` parameter instead of `linkDomain`
First, verify that Dynamic Links is enabled for your Firebase project:
1. Go to the [Firebase Console](https://console.firebase.google.com/)
2. Select your project
3. In the left sidebar, click on "Dynamic Links"
4. If you see a "Get Started" button, click it to enable Dynamic Links
5. If it's already enabled, you'll see your existing dynamic links
If Dynamic Links isn't enabled, you need to enable it before proceeding.
Configure your dynamic link domain:
Option A: Use a free page.link subdomain (recommended for testing):
1. In Firebase Console > Dynamic Links
2. Click "Get Started" or "New Dynamic Link"
3. Firebase will automatically assign you a free subdomain like yourproject.page.link
4. Note this domain for use in your app
Option B: Use a custom domain:
1. In Firebase Console > Dynamic Links
2. Click "Add URL prefix"
3. Enter your custom domain (e.g., links.example.com)
4. Follow the DNS verification steps:
- Add the provided TXT record to your domain's DNS
- Wait for DNS propagation (can take up to 48 hours)
- Click "Verify" in Firebase Console
Important: The domain must use HTTPS and have a valid SSL certificate.
Update your Firebase Authentication code to use the correct domain:
For web apps (JavaScript/TypeScript):
import { getAuth, sendPasswordResetEmail } from "firebase/auth";
const auth = getAuth();
const actionCodeSettings = {
// Use 'linkDomain' instead of deprecated 'dynamicLinkDomain'
linkDomain: "yourproject.page.link", // Your configured domain
// OR for custom domains:
// linkDomain: "links.example.com",
// Other required settings:
url: "https://yourapp.com/reset-password", // Your app's reset page
handleCodeInApp: true, // Set to true for mobile apps
};
// Example: Send password reset email
sendPasswordResetEmail(auth, "[email protected]", actionCodeSettings)
.then(() => {
console.log("Password reset email sent!");
})
.catch((error) => {
console.error("Error:", error.code, error.message);
});For mobile apps (React Native/Flutter):
Configure your deep linking according to Firebase documentation.
Test your dynamic link configuration:
1. Send a test email:
// Send a password reset email to yourself
sendPasswordResetEmail(auth, "[email protected]", actionCodeSettings);2. Check the email:
- Open the password reset email
- Click the link
- Verify it redirects to your app correctly
3. Test on different platforms:
- Test on web browser
- Test on iOS device
- Test on Android device
4. Check Firebase Console logs:
- Go to Firebase Console > Authentication > Events
- Look for any errors related to dynamic links
If you're using the deprecated dynamicLinkDomain parameter, update your code:
Before (deprecated):
const actionCodeSettings = {
dynamicLinkDomain: "yourproject.page.link", // DEPRECATED
url: "https://yourapp.com/reset-password",
handleCodeInApp: true,
};After (correct):
const actionCodeSettings = {
linkDomain: "yourproject.page.link", // CORRECT
url: "https://yourapp.com/reset-password",
handleCodeInApp: true,
};Note: The dynamicLinkDomain parameter was deprecated because Firebase now supports custom Hosting link domains through the linkDomain parameter.
For mobile apps, ensure proper configuration:
iOS (Xcode project):
1. Open your Xcode project
2. Go to Target > Info > URL Types
3. Add a URL Scheme matching your bundle ID
4. Configure Associated Domains in Capabilities:
- Add: applinks:yourproject.page.link
- Or for custom domains: applinks:links.example.com
Android (AndroidManifest.xml):
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="yourproject.page.link"
android:scheme="https" />
</intent-filter>Firebase Console configuration:
1. Go to Firebase Console > Project Settings
2. Add your iOS bundle ID and Android package name
3. Download updated config files for each platform
### Understanding Dynamic Link Domains
Firebase Dynamic Links can use two types of domains:
1. Free page.link subdomains: Automatically provided by Firebase (e.g., yourproject.page.link). These are easiest to set up and work immediately.
2. Custom domains: Your own domain (e.g., links.example.com). Requires DNS verification but provides branding consistency.
### Common Migration Scenarios
Migrating from old Firebase project:
If you're migrating from an old Firebase project, dynamic link domains don't automatically transfer. You need to:
1. Reconfigure the domain in the new project
2. Update DNS records if using custom domain
3. Update your app's configuration
Changing domains:
If you need to change your dynamic link domain:
1. Configure the new domain in Firebase Console
2. Update your app's linkDomain setting
3. Keep the old domain active during transition (users may have old links)
4. Update mobile app configurations
### Troubleshooting Tips
1. DNS propagation delays: Custom domain changes can take 24-48 hours to propagate globally.
2. SSL certificate issues: Ensure your custom domain has a valid SSL certificate. Firebase requires HTTPS.
3. App store updates: Changing dynamic link domains may require app store updates if deep linking configuration changes.
4. Testing environments: Use different domains for development, staging, and production.
5. Firebase project permissions: Ensure you have sufficient permissions to configure Dynamic Links in the Firebase Console.
### Security Considerations
- Dynamic links can be used for phishing if not properly secured
- Always verify link domains in your app
- Consider implementing additional security checks for sensitive operations
- Monitor Firebase Console for suspicious activity
### Performance Implications
- Dynamic links add an extra redirect layer
- Consider caching strategies for frequently accessed authentication flows
- Monitor link click-through rates in Firebase Analytics
messaging/UNSPECIFIED_ERROR: No additional information available
How to fix "messaging/UNSPECIFIED_ERROR: No additional information available" in Firebase Cloud Messaging
App Check: reCAPTCHA Score Too Low
App Check reCAPTCHA Score Too Low
storage/invalid-url: Invalid URL format for Cloud Storage reference
How to fix invalid URL format in Firebase Cloud Storage
auth/missing-uid: User ID identifier required
How to fix "auth/missing-uid: User ID identifier required" in Firebase
auth/invalid-argument: Invalid parameter passed to method
How to fix "auth/invalid-argument: Invalid parameter passed to method" in Firebase