0

I am trying to use "password" authentication with Firebase Simple Login in Phonegap but getting this error:

Web Console(857): FirebaseSimpleLogin(): Due to browser security restrictions,
loading applications via `file://*` URLs will prevent popup-based authentication
providers from working properly. When testing locally, you'll need to run a
barebones webserver on your machine rather than loading your test files via
`file://*`. The easiest way to run a barebones server on your local machine is
to `cd` to the root directory of your code and run `python -m SimpleHTTPServer`,
which will allow you to access your content via `http://127.0.0.1:8000/*`. at
file:///android_asset/www/js/firebase-simple-login.js:74

How can we solve this problem? Also what about the Auth settings in Firebase admin GUI. How can we allow Phonegap based apps to access Firebase server?

iFadey
  • 320
  • 3
  • 11
  • 1
    [Engineer at Firebase] This error message is a warning for users loading a file locally, but should actually be harmless for PhoneGap, provided that you are requiring the InAppBrowser and either `cordova.js` or `phonegap.js` in your application. I'll look into hiding this message for the PhoneGap case. Please reach out directly to support@firebase.com if you run into further problems. – Rob DiMarco Nov 01 '13 at 17:43
  • Thanks for details. I will verify if this is a warning or an error. – iFadey Nov 01 '13 at 19:17
  • 1
    Yes you are right. The message is a warning, not an error. Even though it's a warning, Firebase login is not working with Phonegap. FYI I have enabled InAppBrowser and added cordova.js – iFadey Nov 01 '13 at 20:55
  • 1
    Can you reach out to support@firebase.com with this issue? We'd be happy to take a look and find the source of the problem. – Rob DiMarco Nov 02 '13 at 00:24

1 Answers1

-1

The error message states pretty clearly that you can't use popup authentication when accessing a page via file://. So instead of entering a local file path into the browser, you need to run an http server, and use a URL like http://localhost/.

This isn't an issue with Firebase's security but instead a basic browser sandboxing feature.

Getting a server is pretty straightforward. If you're using python, as noted, you can run python -m SimpleHTTPServer. If node.js is more your ball of wax, there is a great, simple http-server lib for node as well. If you're on Mac, you already have one, and otherwise, you could try XAMPP.

Kato
  • 40,352
  • 6
  • 119
  • 149
  • 2
    You didn't got my point. I understand this issue will get fixed when we use web server. But I am not using a browser. I am using Phonegap. – iFadey Nov 01 '13 at 17:37