1

This is how my db rules look like:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write;
    }
  }
}

Here is my server code:

import firebase_admin
from firebase_admin import credentials
from firebase_admin import db

cred = credentials.Certificate('gitvis-blabla-firebase-adminsdk-c3f55-4fk2b82716.json')

firebase_admin.initialize_app(cred, {
    'databaseURL': 'https://gitvis-blabla.firebaseio.com'
})

ref = db.reference('users')
print(ref.get())

None

ishandutta2007
  • 16,676
  • 16
  • 93
  • 129
  • The security rules you're showing apply to Cloud Firestore, while the code you're showing is accessing the Realtime Database. While both databases are part of Firebase, they're completely separate, and the security for one don't apply to the other. To fix the error, you will have to set the rules for the Realtime Database. For a walkthrough of how to do that, see https://stackoverflow.com/a/52129163 – Frank van Puffelen Dec 18 '18 at 04:50
  • Well, this is the Admin SDK. So the rules don't take effect anyway. Something else is going on here. Can you also add a screenshot, of what your root node in the database look like? – Hiranya Jayathilaka Dec 18 '18 at 20:03

0 Answers0