I'm trying to connect to my realtime database from firebase using MicroPython in a ESP32, I was able to retrieve the data using ufirebase but only if the rules were public for reading and writing, now I have the following rules for the database:
{
"rules": {
".read": "auth.uid === <My uid>",
".write": "auth.uid === <My uid>"
}
}
I am able to get my uid from my email and password that were registered in the authentication section in firebase using the micropython-firebase-auth library, but now I am not able of doing the request using ufirebase, I have tried doing a request with urequests in the following way:
import urequests
def get_data():
response = urequests.get("https://<DATABASE_NAME>.firebaseio.com/<NODE>.json?auth=<My uid>")
data = response.json()
return data
But doing so, shows me the following message: {'error': 'Permission denied'}
So I haven't been able of retrieving the information with the applied set of rules, the structure of the data is the following for all of the database.
Example of data to retrieve from the realtime database
Does anyone know how to do a request with micropython once you got the uid?