database - auth !== null 有多安全?火力地堡

标签 database security firebase firebase-authentication firebase-security

我使用 Firebase 已经有一段时间了,但直到现在我才决定真正研究一下安全规则。

我的问题是,“auth !== null”有多安全?是的,我知道这意味着只有经过身份验证的用户才能访问数据,但是通过身份验证有多容易?有人可以注册该应用程序,然后使用这些凭据将 GET 请求直接发送到我的数据库中吗?

就像我说的,我是安全规则的新手,所以如果这是一个明显的问题,我很抱歉。

这是我的安全规则:

{
  "rules": {
    "Users": {
      "$user_id": {
        ".write": "$user_id === auth.uid",  
        ".read" : "auth !== null",
        "shoofers" : {
          ".write" : "auth != null"
        }
      }
    }
  }
}

谢谢!

尼尔

最佳答案

您可以在登录身份验证后或未经身份验证的情况下授予用户对数据库的访问权限。 但是允许用户通过身份验证访问您的数据库是好的和安全的

具有身份验证的安全规则是

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

无需身份验证

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

关于database - auth !== null 有多安全?火力地堡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45195285/

相关文章:

javascript - 在/items : Client doesn't have permission to access the desired data处获取permission_denied

javascript - 从服务器文件夹下载文件

forms - 通过验证更改用户密码( symfony2 )

android - 致命异常 : java. lang.SecurityException : ! @Firebase 中注册的警报 (500) 过多

java - 已签名的 Jar 和 doPrivileged 无法解决访问控制异常

delphi - Delphi 和 PHP 中的安全 key 对加密解决方案?

android - 如何根据 Kotlin 中的键值从 firebase 读取数据

database - 为应用程序生成数据

用于跟踪用户通知或事件的数据库(类似于 Facebook)

python - Cassandra cqlsh 连接错误 : 'Unable to connect to any servers' , .cql_version '3.4.0' 不受远程支持