【发布时间】:2018-02-01 05:18:41
【问题描述】:
我在启用 Google 登录 的 Angular4 项目中使用 Firebase Auth (firebase 4.1.3)。在 localhost 上工作时,一切都按预期工作。但是,在部署我在 Google App Engine 上托管的应用时,身份验证弹出窗口会失败并出现“auth/unauthorized-domain”错误。
如何在 Firebase 中将我的自定义域列入白名单?
检查已经完成:
- 我的 firebase 项目已启用并启用结算功能
- 带有弹出窗口的 Google 登录可在本地主机上运行
- Google 应用引擎域已在 Firebase 控制台的 Authenticacion 模块中登录方法下的“授权域”中列入白名单。
- 在我的 Angular 应用程序中仔细检查了 javascript firebase 配置(我复制粘贴了 firebase 控制台给出的 sn-p)。
- 在 Google Cloud Console 中,默认 Web API 密钥没有访问限制,并且 OAuth 客户端 ID 已在“授权 JavaScript 来源”列表和“授权重定向 URI”列表中包含我的 App Engine 域 (@987654321 @)。
其他一些类似的 SO 问题是指检查以前的事情,甚至在将新域列入白名单后等待长达 20 分钟以允许更改传播。但是这些建议都没有对我有用。
注意:完整的错误代码
{
code: "auth/unauthorized-domain"
message: "This domain (PROJECT.appspot.com) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab."
}
任何帮助将不胜感激。
【问题讨论】:
标签: angularjs google-app-engine firebase firebase-authentication