Firebase:权限被拒绝-setValue() [英] Firebase: Permission denied - setValue()

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

问题描述

我无法使用setValue()将值设置为Firebase数据库.在日志中,它返回我setValue于...权限被拒绝.我检查了规则:

I cannot set value to my Firebase Database using setValue(). In logs it returns me setValue at ... Permission denied. I checked my rules:

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

推荐答案

尝试将规则更改为以下内容,它将起作用.

Try changing your rules to the following and it'll work.

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

根据弗兰克·范·普菲伦(Frank van Puffelen)的评论,您的规则要求用户经过身份验证.

As per Frank van Puffelen's comment your rules require the user is not authenticated.

如果您有其他选择,可以在此处了解更多信息.需要更安全的身份验证

You can read more about the authentication rules here for other options if you need more secure authentication

希望这对您有帮助

这篇关于Firebase:权限被拒绝-setValue()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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