身份验证失败-权限被EmberFire拒绝 [英] Authentication failed - Permission Denied with EmberFire

查看:116
本文介绍了身份验证失败-权限被EmberFire拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我遵循有关Ember js 2.0的简单初学者教程时,我正在尝试在firebase上建立一个基本的数据存储。例如,我正在学习本教程:

I'm trying to set up a basic datastore at firebase when following simple beginner tutorials on Ember js 2.0. For example I am following this tutorial:

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

我似乎总是在使用Firebase URL进行身份验证时遇到问题。也就是说,本教程试图将信息写入到我的Firebase项目中,但是Chrome浏览器检查器显示我正在从Firebase中收到权限被拒绝错误。

I always seem to have a problem with authentication with the Firebase URL. That is, I've gotten to the bit where this tutorial tries to write information to my firebase project, but the Chrome Inspector shows I'm getting a 'permission denied' error from firebase.

防火墙警告:在/ posts / -KIpiNcp3WVRkCfwl_lW上更新失败:Permission_denied

我已经用 ember install安装了emberfire余烬。我已将我的Firebase URL添加到config / environment.js中:

I have installed emberfire with ember install emberfire. I have added my firebase URL to config/environment.js:

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

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

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

Initially I did not change any authentication settings on my Firebase project (which I think is odd as I should need to authenticate to the Firebase project somehow). Then I tried adding my domains, firstly my IP and then the domain name associated with my IP.

我正在使用:
ember-cli:2.5。 1

I'm using: ember-cli: 2.5.1

我很喜欢有人可以指出我正确的方向。谢谢。

I'd love it someone could point me in the right direction. Thank you.

推荐答案

临时不安全(!)方法,并带有指向安全方法的链接



这至少会使您超越症结所在,但您需要在完成后立即撤消。

Temporary insecure(!) approach with link to secure approach

This will at least get you past the sticking point, but you need to undo it soon as you're done.

在浏览器的Firebase控制台中,请转到数据库->规则并替换规则:

In the Firebase console in your browser, go to Database -> Rules and replace the rules:

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

{
  "rules": {
    ".read": true,
    ".write": true"
  }
}

这将允许您阅读本部分。

Which will allow you to get through that part of the tutorial.

警告:,这将允许任何人写入您的数据库,因此请尽快重置规则!

Warning: this allows anyone to write to your database, so reset the rules as soon as possible!

更多详细信息和安全方法,请参见此问题的答案我的Firebase访问问题

More more details and a secure method, see this answer to the same Firebase access issue.

这篇关于身份验证失败-权限被EmberFire拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆