簡體   English   中英

Phonegap的Firebase簡單登錄問題

[英]Firebase Simple Login Issue with Phonegap

我試圖在Phonegap中對Firebase簡單登錄使用“密碼”身份驗證,但出現此錯誤:

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

我們如何解決這個問題? 另外,Firebase管理GUI中的“身份驗證”設置如何。 我們如何允許基於Phonegap的應用程序訪問Firebase服務器?

錯誤消息非常清楚地表明,通過file://訪問頁面時,您不能使用彈出式身份驗證。 因此,您不需要運行瀏覽器,而無需在瀏覽器中輸入本地文件路徑,而需要使用http://localhost/類的URL。

這不是Firebase的安全性問題,而是基本的瀏覽器沙箱功能。

獲取服務器非常簡單。 如前所述,如果您使用的是python,則可以運行python -m SimpleHTTPServer 如果node.js更適合您,那么node也有一個非常簡單的http-server lib。 如果您使用的是Mac,則已經有一個 ,否則,您可以嘗試XAMPP

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM