firebasefirebase-realtime-databasefirebase-authenticationfirebase-security

Firebase simulate read denied


In my firebase project, I have implemented Google Authentication.

My firebase rules looks like the following:

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

The database has the following snapshot: enter image description here

Everytime I try to simulate. Firebase says that the "Simulate read denied".

enter image description here

Any ideas that I am doing wrong here?


Solution

  • I realised the problem. I was accessing "/users" but instead, I should be accessing "/users/$uid" to simulate rule.