I followed the Get started with Cloud Firestore guide:
https://firebase.google.com/docs/firestore/quickstart
here is the code:
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
cred = credentials.Certificate("PATH TO KEY")
firebase_admin.initialize_app(cred)
db = firestore.client()
users_ref = db.collection(u'users')
docs = users_ref.stream()
for doc in docs:
print(f'{doc.id} => {doc.to_dict()}')
I've tried to set DB rules to test mode for read-write access , and I created an IAM user and generated a key but nothing seems to work.
Here is the error message:
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.PERMISSION_DENIED
details = "Missing or insufficient permissions."
debug_error_string = "{"created":"@1598292572.851377000","description":"Error received from peer ipv4,"file":"src/core/lib/surface/call.cc","file_line":1062,"grpc_message":"Missing or insufficient permissions.","grpc_status":7}
google.api_core.exceptions.PermissionDenied: 403 Missing or insufficient permissions.
Thank you.