I am trying to delete a node from firebase database using rest api. I can read the database, but when i try to delete or write to it , it gives me permission denied error. I am using python requests package to make rest calls. here are my security rules for firebase database
{
"rules": {
".read": "auth.uid == 'foobar'",
".write":"auth.uid == 'foobar'"
}
}
I have a user in firebase console -> authentication -> users with user uid as "foobar". Here is the python code to make delete request
url='https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=<my-api-key>'
data={
"email": "my-email",
"password": "my-pass",
"returnSecureToken": "true"
}
contents = requests.post(url,data)
idToken= contents.json()["idToken"]
payload = {"auth":idToken}
#i also tried sending uid with payload
#payload={"auth":idToken,"uid":"foobar"}
url="https://my_app_id.firebaseio.com/Home01/.json";
contents=requests.delete(url,data=payload)
how can i make delete request successfully.