firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.83k stars 891 forks source link

Breaking change to Ionic WebView breaks auth on Cordova 8 + Ionic #1244

Open andyepx opened 6 years ago

andyepx commented 6 years ago

[REQUIRED] Describe your environment

[REQUIRED] Describe the problem

Steps to reproduce:

It appears that Ionic Webview has changed and it's not possible to use signInWithRedirect on Android as it's now serving content from an integrated http server, at http://localhost:8080 instead of using file:// as previously. This seems to break the login flow.

More info are available at https://github.com/ionic-team/cordova-plugin-ionic-webview

How can I force Firebase Auth to detect my Cordova setup?

Relevant Code:

I have implemented the auth in the simplest way:

    const provider = new firebase.auth.GoogleAuthProvider();
    firebase.auth().signInWithRedirect(provider)
      .then(function (x) {
        console.log(x);
      });

And after a successful login, the OAuth handler redirects to http://localhost:8080 which is an empty page, instead of flowing back to the app.

ericgopak commented 5 years ago

Have you checked if your app allows navigation to URLs with http:// protocol? (perhaps your config.xml only allows for https:// )

Try adding the following entry to your config.xml:

<allow-navigation href="http://*" />

This solution worked for a possibly related issue: https://stackoverflow.com/a/53566771/2779681

MSchmack commented 5 years ago

Partially works for me with

afterwards it tries to open the login with the in-app browser "403" which leads to the issue #507

Related open issue, #507

esase commented 5 years ago

Partially is not enough anyway

ishaiavrahami commented 4 years ago

Any solution?

louisameline commented 4 years ago

Starting from April 2020 (this month!), Apple will no longer accept hybrid apps that do not use WKWebView. As others, I made the switch from the UIWebView. Only to realize that the regular Cordova WKWebView has bugs that the Ionic webview fixes. So, now would be a great time to decide if something can be done, because we're about to lose our workaround. Thank you