Skip to content

Firebase Auth error

Firebase Auth: “Unable to process request due to missing initial state”

Missing initial state is the Firebase Auth error signInWithRedirect hits when the browser partitions or blocks third-party storage. Recent Chrome, Firefox and Safari all do, so the redirect flow needs your app and its authDomain on the same domain.

Rather hand it over? App Fix Ticket: One reproducible bug in an existing mobile or web app, diagnosed and fixed.The Fix is $1,200 in total. The $450 Diagnosis is optional and credited toward it.

Full refund if Simon can’t take it on once he sees your project, or if you cancel before work starts. Refund terms.

Short answer

On Firebase Hosting with a custom domain or a web.app subdomain, set authDomain to that domain. On other hosts, proxy /__/auth/ to your firebaseapp.com domain, or switch to signInWithPopup. Add your domain to Authorized domains and https://your-domain/__/auth/handler to the provider’s redirect URIs, then redeploy.

Rather not fix it yourself? App Fix Ticket fixes one reproducible bug at a fixed price, with an optional Diagnosis that is credited toward the fix.

Why the redirect sign-in fails, and the fix

  1. 01

    authDomain still points at firebaseapp.com

    “This ensures that your app and the auth iframe use the same domain, which prevents the sign-in issue.” Firebase, Redirect best practices (Option 1)

    With the app on its own domain and authDomain on firebaseapp.com, the browser keeps them apart. On Firebase Hosting, set authDomain to your custom domain and add https://your-domain/__/auth/handler to the provider’s redirect URIs.

    const firebaseConfig = {
      // ...
      authDomain: 'app.example.com',
    };
  2. 02

    The app isn’t on Firebase Hosting

    “The signInWithRedirect flow starts by redirecting from your app domain to the domain specified in the authDomain parameter in firebase config” Firebase, Redirect best practices (Option 3)

    On Vercel, Netlify or your own server, proxy /__/auth/ to your firebaseapp.com domain as a transparent rewrite, not a 302 redirect. Then set authDomain to your domain and add the redirect URI and authorized domain as above. On Netlify the rule is /__/auth/* https://PROJECT_ID.firebaseapp.com/__/auth/:splat 200.

    // vercel.json
    {
      "rewrites": [
        { "source": "/__/auth/:path*", "destination": "https://PROJECT_ID.firebaseapp.com/__/auth/:path*" }
      ]
    }
  3. 03

    A popup would do

    “Use signInWithPopup() instead of signInWithRedirect().” Firebase, Redirect best practices (Option 2)

    Popups avoid the redirect storage problem. Call signInWithPopup from the click handler and get the user from its result. Popups are sometimes blocked, and the flow is less smooth on phones.

  4. 04

    Self-hosting the helper files

    Copying the sign-in helper files to your domain also works, but Firebase says it doesn’t support Apple sign-in or SAML. Use it only when a proxy isn’t possible.

Checked against the vendor’s docs on : Firebase docs: Best practices for using signInWithRedirect.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
A buyer in the United States, July 2022. Shopify on Fiverr
Read 126 of the 127 Fiverr reviews

Related: Firebase Google sign-in popup blocked · Firebase auth/unauthorized-domain · Google OAuth redirect_uri_mismatch · Firebase missing-or-invalid-nonce

Questions

More on this error

When did this start?

Firebase made one of its options required for redirect sign-in on Chrome M115+ from June 24, 2024. Firefox 109+ and Safari 16.1+ already needed it.

Is an app on firebaseapp.com affected?

No. Apps on Firebase Hosting at a firebaseapp.com subdomain are not affected and need no change.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it. If you already know the cause, you can pay for the fix directly; if not, start with a written diagnosis, which is credited toward the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

A different error?

Ask Simon for a price range

Send the error and what you were doing. Simon replies by email, usually within one business day, with a price range.