Firebase:AngularFire中的本地开发和测试 [英] Firebase: Local Development and testing in AngularFire
问题描述
我正在使用Angularfire制作网站.我正在尝试将基于oauth
的登录与google
集成以进行用户身份验证,但是当我尝试运行index.html
文件并尝试登录时会显示以下错误
I am using Angularfire to make a website. I am trying to integrate oauth
based sign in with google
for user authentication but when I try to run index.html
file and try to login following error is displayed
11:59:28.189 Error: There are no login transports available for the requested method.
Stack trace:
Mg@file:///G:/Project/root/js/firebase.js:142:1267
dh/<@file:///G:/Project/root/js/firebase.js:163:141
1 app.js:31:4
我在stackoverflow上搜索了此内容,并得到了答案,它表示我需要为此设置服务器.
然后我查看了Firebase文档,他们说
I searched on stackoverflow for this and got this answer , it says that I need to setup a server for this.
Then I looked at firebase docs and they said
出于安全原因,如果您使用的是基于网络的OAuth流 (Facebook,Twitter,Github或Google),仅属于您的域 允许白名单为您的应用启动身份验证.这 不适用于电子邮件和密码,匿名或自定义 身份验证方法.所有Firebase应用程序均具有localhost和 默认情况下,启用127.0.0.1进行本地开发和测试.
For security reasons, if you're using a web-based OAuth flow (Facebook, Twitter, Github, or Google), only domains that you whitelist are allowed to initiate authentication for your app. This does not apply to Email & Password, Anonymous, or Custom authentication methods. All Firebase applications have localhost and 127.0.0.1 enabled by default for local development and testing.
将身份验证托管在Firebase上后,身份验证可以正常工作,但是部署需要很多时间,有时甚至无法访问Internet.
因此,请建议我最简单的方法,以便我可以在localhost上运行我的应用.
The authentication works fine after I host it on firebase but deploying takes a lot of time and also sometimes even I don't have access to internet.
So please suggest me easiest manner so I can run my app on localhost.
推荐答案
在本地运行Firebase(或任何其他)网站的简单方法是使用
An easy way to locally run a Firebase (or any other) web site is to use the Firebase tools and then run
firebase serve
请参见此博客文章引入本地服务器.
这篇关于Firebase:AngularFire中的本地开发和测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!