Auth如何与Firebase预览频道一起使用?

时间:2020-10-21 16:49:17

标签: firebase firebase-authentication firebase-hosting

Firebase最近宣布了预览频道:https://firebase.google.com/docs/hosting/test-preview-deploy

但是我想知道该如何与使用Firebase身份验证的应用程序一起使用(可能每个使用Firebase身份验证的应用程序)。

当前,由于您必须将URL添加到“授权域”和Google Cloud控制台中的Oauth 2.0 Web客户端“ Authorized JavaScript origins”,因此您实际上可以登录。

1 个答案:

答案 0 :(得分:2)

Firebase CLI在部署时应自动同步授权域。除非您根据当前主机名在Firebase SDK配置中动态设置authDomain,否则您无需向OAuth 2.0 Web客户端添加任何内容(提示:不要这样做!)。

如果从没有权限修改Firebase Auth的服务帐户或用户进行部署,则可能无法同步。在这种情况下,您应该看到以下内容的输出:

[hosting:channel] Unable to add channel domain to Firebase Auth.

如果您没有看到类似的信息,并且您使用的是最新版本的Firebase CLI,并且身份验证域未同步,请在Firebase CLI GitHub存储库上file an issue