0Day Forums
Firebase unable to process request due to missing initial state - Printable Version

+- 0Day Forums (https://zeroday.vip)
+-- Forum: Coding (https://zeroday.vip/Forum-Coding)
+--- Forum: Flutter & Dart (https://zeroday.vip/Forum-Flutter-Dart)
+--- Thread: Firebase unable to process request due to missing initial state (/Thread-Firebase-unable-to-process-request-due-to-missing-initial-state)



Firebase unable to process request due to missing initial state - Sirwhenas939 - 07-21-2023

I am trying to use phone auth from `firebase` and I get this error now.

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

This was working a week ago and no longer works.


RE: Firebase unable to process request due to missing initial state - consolidant17299 - 07-21-2023

I experienced the issue with an iphone web app. I went into Settings -> Safari and disabled 'Prevent Cross-Site Tracking'.


RE: Firebase unable to process request due to missing initial state - work397 - 07-21-2023

I have solved this by registering my app with SafetyNet with SHA2. To do this follow these steps:

1. Get your SHA2. If you don't know how to get this, follow this tutorial:

Note. This youtube link is for SHA1 but you will notice that SHA2 will be shown here if you pay attention.
2. Go to your Firebase Console then, go to Project Settings > App Check. You will notice your app is "Unregistered." click this to register your app.
3. Enter the SHA2 you copied and Accept some terms below then click Save. you will notice the "Registered" with green check icon.

Btw, this error happens on one of my devices but not on another. I also searched through this error and no one has solved this including this page. This happens in my phone authentication using firebase when getting an OTP as I send my phone number. The app tries to redirect you to a browser for Recaptcha for verification if you don't have SafetyNet. Thus, having no SafetyNet will cause your app to always be redirected for Recaptcha which sometimes causes an error. Thus, to solve this, register your app with Safety Net. to understand this, read this documentation.

[To see links please register here]

Focus on 2. Enable App Verification and you will notice that recaptcha is just an alternative for SafetyNet.


RE: Firebase unable to process request due to missing initial state - nontrespass380365 - 07-21-2023

It had on the Ionic/Angular/Capacitor app too. i.e. Android and Chrome. Firebase Auth with Microsoft Login.

So I have cleared all the chrome browser data on the Android device and then no issues. i.e. working fine now.

More workarounds:

[To see links please register here]




RE: Firebase unable to process request due to missing initial state - sybilixf - 07-21-2023

### I came across this error and this is how I fixed it!

- Go to your firebase's project console
- Expand the `Build` section and click on app check
- You will notice that your app is not registered on `SafetyNet`
- Firebase will auto-detect your SHA-256 certificate
- You will have to accept some terms and then you confirm

### *NB: Note that `SafetyNet` is deprecated and will be soon removed, you should activate `Play Integrity`instead.*


Happy Coding!