身份验证失败 - 使用EmberFire

时间:2016-05-28 05:06:44

标签: ember.js ember-data emberfire

我正在尝试在关注Ember js 2.0的简单初学者教程时在firebase上设置一个基本数据存储区。例如,我正在学习本教程:

https://medium.com/@jamesfuthey/a-gentle-introduction-to-ember-2-0-8ef1f378ee4#.d6umfj62j

我似乎总是遇到使用Firebase网址进行身份验证的问题。也就是说,我已经了解了本教程尝试将信息写入我的firebase项目的位置,但Chrome Inspector显示我从firebase获得了“权限被拒绝”错误。

FIREBASE警告:/ posts / -KIpiNcp3WVRkCfwl_lW更新失败:permission_denied

我已经使用 ember install emberfire 安装了emberfire。我已将我的firebase URL添加到config / environment.js:

contentSecurityPolicy:{'connect-src':“'self'HTTPREMOVED // auth.firebase.com wss://*.firebaseio.com”}, firebase:'HTTPREMOVED // ember2-blog-ccb21.firebaseio.com',

注意:我必须删除这些链接上的http元素才能在此发布,因为我的声誉低于10。

最初我没有更改Firebase项目的任何身份验证设置(我认为这很奇怪,因为我需要以某种方式对Firebase项目进行身份验证)。然后我尝试添加我的域名,首先是我的IP,然后是与我的IP相关联的域名。

我正在使用: ember-cli:2.5.1

我爱它,有人可以指出我正确的方向。谢谢。

1 个答案:

答案 0 :(得分:0)

在浏览器的Firebase控制台中,转到数据库 - >规则和编辑规则:

{
    "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
    }
}

{
    "rules": {
    ".read": "auth == null",
    ".write": "auth == null"
    }
}

以上对我有用,它与上一个答案在语法上相同,但我保留了 auth 关键字,所以当我准备好保护数据库时,基本语法已经存在。