I’m trying to implement facebook/twitter/google+ autentication using Firebase v3 in my Ionic1 app, it works fine in the browser but it gives me this error on real devices (Android/iOS):
This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.
I think the problem is that I need to add my app’s domain in the “OAuth redirect domains” section in Firebase, but I don’t know which is my app’s domain when running on a device.
document.location.host and window.location.host are blank
As a guy suggested in a StackOverflow response, signInWithCredential works, but you need to get an OAuth token using an OAuth library/plugin like ngCordovaOAuth or cordova-plugin-facebook4/twitter-connect-plugin.
Here’s an example var credential = firebase.auth. FacebookAuthProvider.credential(YOUR_FACEBOOK_TOKEN) firebase.auth().signInWIthCredential(credential)
Your code was a great reference, however the error is still there, what is the relevant code in the solution that gets rid of it?
The problem seems to be related to the fact that the app running on the android device with the --livereload option uses http to get the page served from the dev computer’s ionic own web/app server (CLI), this causes the message from the Firebase server, when running the app in production mode (from the device and not the dev server, as ionic run without the --livereload option would do) the origin becomes file:// and the problem disappears if you followed the instructions above )
Note: My case is somewhat simpler, since I am not using facebook or google auth at the moment, however if there was a way to remove the error that would be really nice.