Firebase unable to process request due to missing initial state

6,300

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: https://www.youtube.com/watch?v=kLaNnuoqnmA 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. https://firebase.google.com/docs/auth/android/phone-auth?authuser=0 Focus on 2. Enable App Verification and you will notice that recaptcha is just an alternative for SafetyNet.

Share:
6,300
shailesz
Author by

shailesz

Updated on December 29, 2022

Comments

  • shailesz
    shailesz over 1 year

    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.

  • SKT
    SKT over 2 years
    This was bugging me for some time. No proper documentation. Thank you for this.
  • user2522885
    user2522885 over 2 years
    Spot on! Thank you for a working solution. And for the record i think you mean SHA256 not SHA2.
  • Shadab K
    Shadab K over 2 years
    Works for Android 11 and latest Firebase version
  • Ricky Levi
    Ricky Levi about 2 years
    i'm not sure how this is related, because this is just another security measure. it's not required. in Chome - i don't see this error, only in Firefox. and at the moment it's to activate captcha which i don't like as a ui process...