Firebase + Ionic3 Error: disallowed_useragent

I just switched to the new Ionic View and right now today, my app in the old Ionic View works while the new Ionic View gives me this well known error:

403 Error - Thats an error. Error: disallowed_useragent his user-agent is not permitted to make an OAuth authorization request to Google as it is classified as an embedded user-agent (also known as a web-view). blah blah blah
In my code I inject the Firebase AuthProvider and use angularfire2 to connect and it looks like

private getProvider(from: string): AuthProvider {
switch (from) {
case ‘twitter’: return new firebase.auth.TwitterAuthProvider();
case ‘facebook’: return new firebase.auth.FacebookAuthProvider();
case ‘github’: return new firebase.auth.GithubAuthProvider();
case ‘google’: return new firebase.auth.GoogleAuthProvider();
}
}

signIn(from: string) {
this.afAuth.auth.signInWithPopup(this.getProvider(from))
. . .
Again, this works great in the browser or old Ionic but not the new Ionic View. I do have a fairly big library with general OAuth connections, but I thought that one of the great reasons to use Firebase is that we would no longer have to use those libraries and manage users ourselves.

Is there a way to do the Firebase auth on an iOS/Android app via Ionic?

2 Likes

you ever get it working, same issue here?

1 Like

The same problem any solution?

Even Im facing same issue any uck in solution?

I believe part of the solution is using signInWithRedirect instead of signInWithPopup. To get it to work I also had to override the user agent in the config.xml, but I’m not sure that is the proper way to do it.