Firebase authorized domains: where the list lives and what to add

Updated Oct 27, 2026 · Pewterkit Guides

Firebase authorized domains are the host names your web app is allowed to start Firebase sign-in from; a page on any other host gets auth/unauthorized-domain. You manage the list in the Firebase console under Security > Authentication > Settings > Authorized domains (as of Oct 2026).

Where the list is in the Firebase console

Firebase's docs give this click path (checked Oct 2026):

  1. Open your project in the Firebase console.
  2. Go to Security > Authentication, then open the Settings tab.
  3. In the Authorized domains section, click Add domain and enter the host name.

Older guides and screenshots put Authentication under Build > Authentication, and some show the list on the Sign-in method tab. If your console looks different, open Authentication and look for its Settings tab; Firebase's troubleshooting page calls it "the Authentication settings dashboard".

If you use Google Cloud Identity Platform, the same list is in the Google Cloud console: Identity Platform > Identity providers, then Add Domain in the Project settings side pane (as of Oct 2026). It is one project-level list, stored as the authorizedDomains field of your project's config, which Google describes as the "List of domains authorized for OAuth redirects".

"Firebase allowed domains" and "whitelisted domains" (the wording in some older Google pages and error messages) mean this same list.

What's on the list by default

  • Your Firebase Hosting domain. Firebase's help page on redirect domains (undated) says your Firebase project's hosting domain is allowed by default. That page also still lists localhost as a default, which Firebase's newer docs contradict for recent projects (next point). That is usually PROJECT_ID.firebaseapp.com, the same host as the default authDomain in your web config. Firebase notes that some Hosting domains don't use the project ID, so check what your project actually shows.
  • localhost, on older projects only. Firebase's docs: "In projects created after April 28, 2025, Firebase Authentication no longer includes localhost as an authorized domain by default." Projects created before that date may still have it.

Open your own list once before you change anything. It is the source of truth for your project.

Which hosts to add

Enter the bare host name: app.example.com, not https://app.example.com/login and not app.example.com:3000. Google's help page says adding a domain allows requests "from any URL and port of that domain", and that you must add the full domain name of every other host your app uses.

Add this Why
Your production host, e.g. example.com The address your users sign in from. A custom domain is a new host, so it needs its own entry.
www.example.com, if you serve it It's a different host name from example.com. Add every host you serve. Subdomain and wildcard questions are covered in Firebase authorized domains: wildcards and subdomains.
Staging and preview hosts Each preview address is its own host. Firebase Hosting preview channels, for example, serve at SITE_ID--CHANNEL_ID-RANDOM_HASH.web.app.
Your custom authDomain, if you changed it Firebase's Google sign-in guide says to add your custom domain to the authorized domains list. Option 1 of Firebase's redirect best-practices page (custom domain as authDomain) adds: "Make sure your continue_uri is in the list of authorized domains."
Email-action continue URLs For email-link sign-in, Firebase says the domain of the continue URL "must be in the authorized domains list in the Firebase Console".
localhost or 127.0.0.1, on a development project Needed for local sign-in on projects created after April 28, 2025. Google "strongly discourages the use of localhost in production projects". See auth/unauthorized-domain on localhost.

If localhost is on your production project's list, Firebase suggests removing it so that code running on someone else's machine can't use your production project.

The error you get when a host is missing

When the page's host isn't on the list, the Firebase JS SDK stops sign-in with this error (text from the SDK's error table):

Firebase: Error (auth/unauthorized-domain).
This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.

For email links and password-reset links, a continue URL on an unlisted host gives a different code, auth/unauthorized-continue-uri ("The domain of the continue URL is not whitelisted").

Already added the host and still see the error? Work through Firebase authorized domains not working.

Authorized domains vs authDomain vs OAuth redirect URIs

Three settings with similar names live in three places.

Authorized domains authDomain OAuth redirect URIs
Where Firebase console > Security > Authentication > Settings The config object you pass to initializeApp() in your code Your OAuth client, on the Clients page of the Google Cloud console
What it holds Host names allowed to start sign-in One host that serves Firebase's sign-in helper at /__/auth/*; default PROJECT_ID.firebaseapp.com Full URLs Google may send the user back to, such as https://PROJECT_ID.firebaseapp.com/__/auth/handler
If it's wrong auth/unauthorized-domain Users see that host during Google sign-in ("Continue to: https://my-app-12345.firebaseapp.com" in Firebase's own example) A redirect_uri_mismatch error from Google

Adding your domain to authorized domains lets sign-in start from it. It does not change the host Google's sign-in screen shows; that follows authDomain. What authDomain is: Firebase authDomain explained. Moving it to your own domain takes more than one setting, and the steps are in How to change your Firebase authDomain.

Change the list by API, Terraform or CLI

Identity Toolkit Admin API (v2)

The list is the authorizedDomains field of projects/PROJECT_ID/config. PATCH replaces the whole field, so read the list, add your host, and write the full list back. Firebase's own CLI does exactly this: its helper reads the current domains, then sends "the full list of authorized domains" with updateMask set to authorizedDomains.

PROJECT_ID="your-project-id"
TOKEN="$(gcloud auth print-access-token)"

# 1. Read the current list
curl -s \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "x-goog-user-project: ${PROJECT_ID}" \
  "https://identitytoolkit.googleapis.com/admin/v2/projects/${PROJECT_ID}/config"

# 2. Write the full list back, including the new host
curl -s -X PATCH \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "x-goog-user-project: ${PROJECT_ID}" \
  -H "Content-Type: application/json" \
  -d '{"authorizedDomains": ["your-project-id.firebaseapp.com", "your-project-id.web.app", "example.com", "www.example.com"]}' \
  "https://identitytoolkit.googleapis.com/admin/v2/projects/${PROJECT_ID}/config?updateMask=authorizedDomains"
  • Replace the list in step 2 with what step 1 returned plus your new host. Anything you leave out is removed.
  • The x-goog-user-project header sets the quota project. Google says to add it when a call returns an error saying user credentials are not supported or the quota project is not set, and the caller needs serviceusage.services.use on that project. Firebase's CLI sends the header on both calls.
  • The caller needs firebaseauth.configs.get to read and firebaseauth.configs.update to write. The Identity Toolkit Admin and Identity Toolkit Editor roles include both.
  • The token needs one of the scopes Google lists for this method, such as https://www.googleapis.com/auth/cloud-platform.

Run it against a development project first.

Terraform

Firebase's Terraform guide sets the list with the authorized_domains argument of the google_identity_platform_config resource. Its example lists localhost, PROJECT_ID.firebaseapp.com and PROJECT_ID.web.app. Leave localhost out of production configs.

Firebase CLI

Firebase's docs describe no CLI command for editing this list (checked Oct 2026). According to the firebase-tools source, firebase hosting:channel:deploy adds each preview channel's host to the list unless you pass --no-authorized-domains, and removes the hosts of expired channels during later channel deploys. If the CLI can't update the list, it prints a warning and the deploy carries on, so check the list after a preview deploy instead of assuming.

How to confirm a host is on the list

  1. Reload the Authorized domains list in the console and look for the exact host.
  2. Or run the GET call above and look for the host in authorizedDomains.
  3. Fully reload your app on that host, then start sign-in. The SDK checks the list once per page load and keeps that result, so an already-open tab can keep failing after you add the host.

FAQ

Where are authorized domains in the Firebase console?

Security > Authentication > Settings tab > Authorized domains, then Add domain (Firebase's docs, as of Oct 2026). Older guides say Build > Authentication, and some show the list on the Sign-in method tab.

Is localhost an authorized domain by default?

Not on projects created after April 28, 2025; add it yourself on a development project if you need it. Projects created before that date may still have it. Google strongly discourages localhost on production projects.

Do I include https:// or a port?

No. Enter the host name only, such as app.example.com. Google's help page says an entry allows any URL and port on that host.

Is "authorized domains" the same as authDomain?

No. Authorized domains is the console list of hosts allowed to start sign-in. authDomain is one field in your Firebase config that names the host serving Firebase's sign-in helper, and that host is what users see during Google sign-in.

Can I add authorized domains with an API?

Yes. Call PATCH https://identitytoolkit.googleapis.com/admin/v2/projects/PROJECT_ID/config?updateMask=authorizedDomains with the full list, or use Terraform's authorized_domains argument. Send every host you want to keep, not only the new one.

Sources

  1. Authenticate with Firebase using Email Link in JavaScript (Firebase docs)
  2. Passing state in email actions (Firebase docs)
  3. Authentication FAQ and troubleshooting (Firebase docs)
  4. Set a web app's OAuth redirect domains (Firebase Help)
  5. Authenticate Using Google with JavaScript (Firebase docs)
  6. Learn more about web apps and the Firebase config object (Firebase docs)
  7. Best practices for using signInWithRedirect: Option 1 (Firebase docs)
  8. Manage Hosting resources: preview channel URLs (Firebase docs)
  9. Signing in users with Google: Identity Platform (Google Cloud docs)
  10. Identity Platform REST v2: Config resource (Google Cloud)
  11. Identity Platform REST v2: projects.updateConfig (Google Cloud)
  12. Identity Platform access control with IAM (Google Cloud)
  13. Identity Toolkit IAM roles and permissions (Google Cloud)
  14. Authenticate for using REST: setting the quota project (Google Cloud)
  15. Get started with Terraform and Firebase (Firebase docs)
  16. Using OAuth 2.0 for Web Server Applications: redirect_uri_mismatch (Google Identity)
  17. Firebase JS SDK auth reference: AuthErrorCodes
  18. firebase-js-sdk source: auth error messages (errors.ts)
  19. firebase-js-sdk source: origin check cached per page (popup_redirect.ts)
  20. firebase-tools source: getAuthDomains and updateAuthDomains (gcp/auth.ts)
  21. firebase-tools source: preview channel auth domains (hosting/api.ts)
  22. firebase-tools source: hosting:channel:deploy (hosting-channel-deploy.ts)

How this page was made: drafted with AI from the sources listed, reviewed by Pewterkit. Docs checked Oct 27, 2026. Spotted something out of date? Tell us.

Related guides