hobbit
hobbit

Reputation: 63

Info about Auth in Firebase Realtime Database

Info about Auth in Firebase Real-time Database

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). In this moment database is in test mode, so read and write are set to 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 ☺️

Upvotes: 0

Views: 71

Answers (1)

Andrii Turkovskyi
Andrii Turkovskyi

Reputation: 29438

In Firebase console find rules tab for your database and set:

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

In this case anyone can read, but only authorized user can write

This tab:

enter image description here

Upvotes: 2

Related Questions