Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase missing initial state on auth request

I am trying to use Apple sign-in with my Flutter/Firebase web app. It works fine with a popup browser tab, so I know the general configuration is correct. However, when the redirect flow is used instead of the popup, an error results. When the Apple sign-in is complete, it makes a POST to Firebase's https://YOUR_FIREBASE_PROJECT_ID.firebaseapp.com/__/auth/handler URL which includes a code and id_token. However, the Firebase Auth handler page gives the following error:

Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared.

Is there some configuration that I am missing to save the state in session storage before redirecting to the sign in page? Or am I missing something else?

like image 355
jon Avatar asked Mar 16 '26 21:03

jon


1 Answers

Edit

To use Apple Sign In with Flutter apps it's required to implement a callback endpoint that redirects the user to the app with the sign in response. The Firebase callback is not supported. See this doc for a guided step about how to implement such endpoint


Original Answer

There is an open issue in firebase-js-sdk Github that addresses this issue: https://github.com/firebase/firebase-js-sdk/issues/4256. We probably need to await for a solution from Firebase team

like image 51
GGirotto Avatar answered Mar 18 '26 21:03

GGirotto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!