简体   繁体   English

Firebase 实时数据库中有关 Auth 的信息

[英]Info about Auth in Firebase Realtime Database

Info about Auth in Firebase Real-time Database Firebase 实时数据库中有关 Auth 的信息

Hello everyone, in these days I made my first app in flutter that reads from a real-time Firebase database a list of data (cars info, because it's a car catalog read from the main website).大家好,这些天我在 flutter 中制作了我的第一个应用程序,它从实时 Firebase 数据库读取数据列表(汽车信息,因为它是从主网站读取的汽车目录)。 In this moment database is in test mode, so read and write are set to true.此时数据库处于测试模式,因此读取和写入设置为 true。 I want that who downloaded app can read all cars list without sign in, so in this case I have to leave the read property with true value and the write one with false value?我希望下载应用程序的人无需登录即可读取所有汽车列表,所以在这种情况下,我必须将读取属性保留为真值,将写入属性保留为假值? Or there is another better way to authorise people to read list without sign in, maybe with a key or other I don't know.或者还有另一种更好的方法来授权人们在不登录的情况下阅读列表,可能使用密钥或其他我不知道的方式。 Thank you very much who read all the message ☺️非常感谢阅读所有留言的各位☺️

In Firebase console find rules tab for your database and set:在 Firebase 控制台中找到您的数据库的rules选项卡并设置:

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

In this case anyone can read, but only authorized user can write在这种情况下,任何人都可以阅读,但只有授权用户才能写

This tab:此选项卡:

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM