0

I have a running app for iOS and Android that use the BaaS service provided by Google Firebase. At the moment the rules that are set in firebase will not permit to read from firebase if the user isn't authenticated. Since I need to read the data to implement some data research features into a chrome extension, how I can set the rules to be able to query firebase without authenticating the user in my vue app?

{
  "rules": {
    "Users": {
      ".read": "auth != null",
      ".write" : "auth != null",
      ".indexOn": "uid"
    },
    "Posts" : {
      ".write" : "auth != null",
      ".indexOn": ["category", "creator"],
      ".read": "auth != null",
        
    },
    "errors" : {
      ".write" : "auth != null",
      ".read" : false
    },
    "PostsQR" : {
      ".write" : "auth != null",
      ".indexOn": ["codeQR"],
      ".read": "auth != null",
    }
  }
}
user9741470
  • 169
  • 12
  • 1
    Before opening up your database to anyone with an internet connection, you should read this: https://stackoverflow.com/questions/46476691/cons-of-letting-unauthenticated-users-access-database-in-firebase – Doug Stevenson May 15 '22 at 18:46
  • @DougStevenson we've changed the strategy and at the moment we want to give access only to authenticated users. There is just a problem, after login I get this error if I try to read the database from a vue component `FirebaseError: Missing or insufficient permissions.` – user9741470 May 16 '22 at 09:13

0 Answers0