Firebase CLI登录时出现redirect_uri_mismatch错误

4
无法登录Firebase CLI。
firebase login 

在浏览器中生成以下错误提示:

The redirect URI in the request, http://localhost:9005, does not match the ones authorized for the OAuth client. Visit https://console.developers.google.com/apis/credentials/oauthclient/...?project=... to update the authorized redirect URIs.

观察结果:

  • http://localhost:9005,以及包括斜杠和https协议的所有可能变体都在Web OAuth客户端下列出。

  • ?project=xxx 指向错误的项目ID。

firebase login:ci --interactivefirebase login --reauth 返回完全相同的结果。

Github问题被忽略了。我真的很想使用云函数功能。


2
尝试使用 firebase login --no-localhost 命令登录? - Michael Bleigh
@MichaelBleigh 我试过了,但是对于 Web 应用程序来说不允许使用 --no-localhost。查看 CLI 的源代码后发现问题出在我之前为另一个项目在 .bash_profile 文件中导出了 $FIREBASE_CLIENT_ID。 - matthiasdv
1个回答

1
解决方案是使用以下命令:
firebase login --no-localhost

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接