-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Unable to process request due to missing initial state.
#33
Comments
Hi @braincomb, |
Hi @robingenz , This was tested on a physical Android device running your plugin with native auth. Firefox was the only browser that showed the error and did not redirect back to the app. For iOS I was only able to test with XCode emulator, no issues there. EDIT: I'd like to add that this only happens with Twitter provider. My guess is that any provider that uses a Callback URL will open an external browser for the redirect. Google provider works fine which opens a popup on the phone. |
Thank you for the information. Regarding your suggestion: Unfortunately I could not find a way to tell the Firebase SDK which browser to open. |
Unable to process request due to missing initial state.
@robingenz Thank you for looking into this. Interestingly enough, step 3 under Handle the sign-in flow with the Firebase SDK from the Authenticate Using Twitter on Android actually states:
Which from our testing showed it doesn't. I have also looked at how Facebook authentication behaves since it also uses a callback URL, and noticed that it opens a Custom Tab. Granted some extra configuration needed to be done in XML files. Would something similar be possible to achieve here for Twitter auth to use a custom tab? |
@braincomb I am very busy this week. I will have a look at it this weekend/next week. |
What do you mean exactly? Does a Google Chrome Custom Tab appear even though you have Firefox as your default browser? Or how did you notice that?
Which changes were made exactly? Do you have references? |
Yes, exactly, Chrome Custom Tab always opens regardless of what the default browser is.
This is from your Facebook Setup documentation: there's an activity for Either way, it looks like Firebase documentation claims that a Custom Tab should open for Twitter auth, but that is not the case. I'll see if I can open a bug issue with them. |
@braincomb You don't have Google Container plugin active? The login won't work with containers. |
Hi, was a solution ever found to this? We are getting an issue where Facebook Compliance is unable to successfully test our Login integration because they are getting this error -- we can't seem to reproduce it on any other devices. But it's this exact same error. The login pop-up window just shows them a white screen. Is there any way to get CapacitorFirebase to use redirect instead of PopUp? |
Unfortunately there is no solution so far.
|
Right.
Yes, this is the platform I was wondering about. I suppose we could call the Firebase API manually. Any plans for supporting this? Thanks. |
Yes
Not yet, but feel free to create a feature request and I'll put it on the raodmap. |
Done, thanks: #224 |
Is your feature request related to a problem? Please describe:
There's currently an issue with the authentication flow where in some cases upon calling the Callback URL (default myapp.firebaseapp.com/__/auth/handler provided by Firebase) the external browser will show this error:
"Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared."
There's a GitHub issue open for this: firebase/firebase-js-sdk#4256
From my own testing and troubleshooting I've concluded that in my experience this only happens with mobile Firefox. However, if we go to Firefox advanced settings and toggle "Open Links in App" to on, then the authentication proceeds as normal by redirecting back to the Capacitor app. Other browsers tested such as Chrome, Brave and Samsung Internet all work normally.
This leads me to believe that if force the authentication to open in a WebView, then we normalize the experience for all users, regardless of what their default web browser is set to.
Describe the solution you'd like:
If possible, force (or as configurable option) the authentication flow to go through
@capacitor/browser
instead of an external browser.Additional context:
I'm unsure if the solution belongs to this plugin, but I thought this was a good place to start. Any advice appreciated!
The text was updated successfully, but these errors were encountered: