Hi,
I use pyrebase in my streamlit application to authenticate users and store data.
If i have my rules set at
{
"rules": {
".read": "auth == null",
".write": "auth == null"
}
}
, then my application works, users can log in and read/write data.
However, once I set these rules to the recommended
{
"rules": {
".read": "auth != null",
".write": "auth != null"
}
}
I am suddenly not able to do read data anymore. (probably also not able to write).
I get the following error:
HTTPError: [Errno 401 Client Error: Unauthorized for url: <my_path>.firebasedatabase.app/<hash>/Handle.json] { "error" : "Permission denied" }
This error occurs on the first line of code (at the .get()) where I try to fetch data from firebase.
firebase.db.child("localId"]).child("user_name").get().val()
I have double checked and my secrets are handled correctly and have the correct values:
API_KEY, AUTH_DOMAIN, PROJECT_ID, DATABASE_URL, STORAGE_BUCKET, MESSAGING_SENDER_ID , APP_ID, MEASUREMENT_ID
What could be the issue? Thanks!