【问题标题】:How to allow read/write access to Firebase database with Email Authentication [duplicate]如何允许通过电子邮件身份验证对 Firebase 数据库进行读/写访问 [重复]
【发布时间】:2016-10-20 23:24:52
【问题描述】:

我正在尝试使用以下安全规则将数据读/写到我的 Firebase 数据库。我很困惑,因为我相信我已经遵循了 firebase 提供的文档。

我已经关注了这个链接 -> FIREBASE USER BASED SECURITY

我只有两个要写入的子节点。用户数据,以及用户输入的无线节点数据。

{
"rules": {
"nodes": {
  "$user_id": {
    ".read": "$user_id === auth.uid",
    ".write": "$user_id === auth.uid"
  }
},
"users": {
  "$uid": {
    ".read": "$uid === auth.uid",
    ".write": "$uid === auth.uid"
   }
  }
 }
}

【问题讨论】:

  • 请提供更多关于您正在尝试什么的详细信息。我们需要一个MVC question 来工作。
  • 一会儿重写问题。
  • 我没有更多的信息。我遵循了firebase文档,目前我迷路了。除了允许对整个数据库进行真正的读/写访问。这不是我想要的。需要有任何和所有子节点可供经过身份验证的用户访问。目前仅使用电子邮件/密码身份验证。

标签: android firebase firebase-realtime-database firebase-security


【解决方案1】:

我能够在这里找到答案。我要做的就是允许经过身份验证的用户读/写数据。

在我搜索了不同的搜索查询后,这个问题回答了我的问题。

使用 [firebase] 标签,我能够搜索问题并找到它。

Restricting child/field access with security rules

【讨论】:

  • 规则不能用于过滤数据这一事实是 Firebase 新手的常见困惑来源之一。很高兴听到你找到了它。
猜你喜欢
  • 2018-04-01
  • 1970-01-01
  • 1970-01-01
  • 2018-02-12
  • 2021-05-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多