简体   繁体   English

Firebase 登录失败

[英]Firebase login failed

I'm having troubles trying to migrate to new firebase console.我在尝试迁移到新的 firebase 控制台时遇到了麻烦。 I'm doing exactly what is on this link: https://firebase.google.com/support/guides/firebase-web#import_your_project_to_the_firebase_console_numbered我正在做这个链接上的内容: https://firebase.google.com/support/guides/firebase-web#import_your_project_to_the_firebase_console_numbered

And this is what happened in the step 2: Firebase login failed The Firebase CLI login request was rejected or an error occurred.这就是步骤 2 中发生的情况: Firebase login failed Firebase CLI 登录请求被拒绝或发生错误。 Please run firebase login again or contact support if you continue to have difficulty logging in.如果您仍然无法登录,请再次运行 firebase 登录或联系支持人员。

Any ideas?有任何想法吗? Thanks since now.从现在开始感谢。

您应该尝试以下方法:

firebase login --no-localhost

A possible reason may be that you are using a proxy.一个可能的原因可能是您正在使用代理。

There is a issue on firebase: Unable to deploy behind a proxy firebase 存在问题:无法在代理后面部署

If you are using proxy, you can refer to this question to: Firebase in NodeJS with HTTP Proxy .如果你使用代理,你可以参考这个问题: Firebase in NodeJS with HTTP Proxy

Not really an answer but further details that don't get formatted correctly in the Comments不是真正的答案,而是在评论中没有正确格式化的更多细节

I have the same issue at an initial login我在初次登录时遇到了同样的问题

The steps I do are (from a cygwin terminal on Windows 10 Professional)我所做的步骤是(来自 Windows 10 Professional 上的 cygwin 终端)

firebase login --no-localhost

After this I get the message "在此之后,我收到消息“

Visit the URL on any device....
Paste authentication code here:

Then, on my browser, I see Google asking if I give Firebase CLI access rights.然后,在我的浏览器上,我看到 Google 询问我是否授予 Firebase CLI 访问权限。 I say yes and then I get an authorization code displayed on the browser.我说是,然后我在浏览器上显示一个授权码。 I copy this code into the cygwin console and then......我将此代码复制到cygwin控制台中,然后......

Error: Authentication Error.

The Firebase CLI does not currently work behind a proxy. Firebase CLI 目前不能在代理后面工作。

We're aware of the issue but don't have a timeline for a fix.我们知道这个问题,但没有修复的时间表。 You can follow along with the tracked issue here: https://github.com/firebase/firebase-tools/issues/155您可以在此处关注跟踪的问题: https ://github.com/firebase/firebase-tools/issues/155

This will work most certainly!!!这肯定会奏效!!!

Please try this command请试试这个命令

set "NODE_TLS_REJECT_UNAUTHORIZED=0"

and then re-run,然后重新运行,

firebase login

Note firebase CLI uses HTTP_PROXY variable if it is set in your environment.注意 firebase CLI 使用 HTTP_PROXY 变​​量,如果它是在您的环境中设置的。 (you can run echo $HTTP_PROXY to verify) So make sure you are EITHER in a network with access to your proxy (eg corporate network) OR that you unset HTTP_PROXY in the terminal that you use for firebase. (您可以运行echo $HTTP_PROXY进行验证)因此,请确保您在可以访问代理的网络中(例如公司网络),或者您在用于firebase的终端中取消设置 HTTP_PROXY Otherwise you will get this misleading error that says “Authentication Error: Your credentials are no longer valid.”否则,您将收到“身份验证错误:您的凭据不再有效”的误导性错误。

You can logout with firebase logout and login in with firebase login .您可以使用firebase logout 注销并使用firebase login 登录 It solves the problem with ease.它可以轻松解决问题。

For me this problem was coming due to network proxy before identification I tried all available solutions on internet.对我来说,这个问题是由于网络代理在识别之前出现的,我尝试了互联网上所有可用的解决方案。

This issue was there due to network proxy, due to proxy it could not get correct SSL.这个问题是由于网络代理而出现的,由于代理它无法获得正确的 SSL。 I requested my network team to direct my connection without proxy.我要求我的网络团队在没有代理的情况下指导我的连接。

Hence, problem got solved!于是,问题就解决了!

Guessing that you are at workplace or behind a proxy.猜测您在工作场所或代理人后面。 This a know error.这是一个已知的错误。 You can follow the status of this issue here - https://github.com/firebase/firebase-tools/issues/155您可以在此处关注此问题的状态 - https://github.com/firebase/firebase-tools/issues/155

For anyone else who might run across this issue and think to themselves, "But, I'm not behind a proxy...": I generally run Little Snitch .对于可能遇到此问题并自言自语的其他任何人,“但是,我不支持代理......”:我通常运行Little Snitch (Note, I don't work for LS, just use the product. This isn't intended as an ad.) After a few minutes of consideration, I realized that it is, in essence, a proxy. (注意,我不是为 LS 工作,只是使用产品。这不是广告。)经过几分钟的考虑,我意识到它本质上是一个代理。 I switched it off (by clicking the "Stop Network Filter" option), and presto, I was able to login.我将其关闭(通过单击“停止网络过滤器”选项),然后我就可以登录了。 Then I switched Little Snitch back on.然后我重新打开了小飞贼。

[Update] [更新]

I was trying to test Cloud Functions locally using firebase serve --only functions .我试图使用firebase serve --only functions在本地测试 Cloud Functions 。 Once I turned Little Snitch back on, I started getting:一旦我重新打开小飞贼,我开始得到:

Error: Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth

So apparently, you can't serve functions locally from behind a proxy, either.显然,您也不能从代理后面本地提供功能。 Turning LS filtering back off fixed the issue.关闭 LS 过滤解决了这个问题。 There's probably a whitelisting option I could use, but I haven't explored that yet.可能有一个我可以使用的白名单选项,但我还没有探索过。 I'm just trying to get back to work at the moment.我现在只是想回去工作。

For anyone who is forced to use a VPN provider to connect, like Astrill for example, you cant use OpenWeb protocol.对于任何被迫使用 VPN 提供商进行连接的人,例如 Astrill,您不能使用 OpenWeb 协议。 Use StealthVPN.使用隐形VPN。 That solved the issue for me这为我解决了这个问题

You need to first add and enable Google provider in Authentication tab of your App before CLI for existing remote project created.在为现有远程项目创建 CLI 之前,您需要先在应用程序的身份验证选项卡中添加并启用 Google 提供程序。

On CLI following worked for me :在 CLI 以下为我工作:

  • npm install -g firebase-tools npm install -g firebase-tools
  • firebase login火力基地登录
  • firebase init火力基地初始化

On Firebase login you get Web interface login to Google account on web browser, then you are logged in.在 Firebase 登录时,您会在 Web 浏览器上通过 Web 界面登录到 Google 帐户,然后您就登录了。

你需要这样写你的电子邮件:

firebase login exmple@email.com

I have tried all of the suggestions above.我已经尝试了上面的所有建议。 None of them were successful.他们都没有成功。

The only thing that worked for me was rebooting my machine (restarting the terminal was not sufficient).唯一对我有用的是重启我的机器(重启终端是不够的)。 Logging in worked flawlessly after that.之后登录工作完美无缺。

On CLI following worked for me:在 CLI 以下为我工作:

Try out For Windows:试用 Windows:

  • Search for PowerShell搜索 PowerShell

  • run as PowerShell administrator以 PowerShell 管理员身份运行

  • npm install -g firebase-tools npm install -g firebase-tools

  • firebase login firebase登录

  • firebase deploy firebase 部署

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM