Search code examples
firebasefirebase-realtime-databasefirebase-security

Firebase rules: where can I find the user to which a id belongs to?


I have a realtime firebase database and its rules include:

{
  "rules": {
        "people" : {
          ".read" : "auth.uid === 'AIza...'",
          ".write" : "auth.uid === 'AIza...'"
        },
  }
}

How can I find out to which user this id belongs to? What does this rule do?


Solution

  • What does this rule do?

    It grants read and write to the rules/people DB node only to the user with uid (from the Authentication service) equal to AIza.... See the doc for more details.

    How can I find out to which user this id belongs to?

    Look at the Authentication part in the console. You can search a user by uid in the Search field as shown below.

    enter image description here