与PhoneGap的火力地堡简单登录问题 [英] Firebase Simple Login Issue with Phonegap

查看:174
本文介绍了与PhoneGap的火力地堡简单登录问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用与PhoneGap的火力地堡简单登录密码的身份验证,但得到这个错误:

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

我们如何才能解决这个问题呢?还什么关于火力地堡管理GUI的验证设置。怎样才能让PhoneGap的基于应用访问火力地堡服务器?

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?

推荐答案

该错误消息指出pretty清楚,通过访问文件的页面时不能使用弹出身份验证://。因此,而不是进入本地文件路径到浏览器中,你需要运行一个HTTP服务器,并使用URL像的http://本地主机/

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.

获取服务器是pretty简单。如果你正在使用python,如上所述,您可以运行蟒蛇-m SimpleHTTPServer 。如果node.js中更是您的蜡球,有一个伟大的,简单的 HTTP服务器 LIB节点为好。如果你在Mac上,你已经有一个,否则,你可以尝试 XAMPP

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.

这篇关于与PhoneGap的火力地堡简单登录问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆