Try to search your question here, if you can't find : Ask Any Question Now ?

Permission denied on Firebase Database using Pyrebase [Python]

HomeCategory: stackoverflowPermission denied on Firebase Database using Pyrebase [Python]
Avatarrupesh asked 4 months ago

I have managed to sign up a user and properly sign them in shortly after they’ve signed up all in the same requests. Also in my request, I am trying to store the user information in the Firebase Database using the python package Pyrebase.

I have properly initialized my firebase app as well as my firebase database within my flask app

config = {
    "apiKey": "apikey",
    "authDomain": "",
    "databaseURL": "",
    "storageBucket": "",
    "messagingSenderId": "930158028418",
    "serviceAccount.json": "path/to/theServiceAccountStuff.json"

app = Flask(__name__)
firebase = pyrebase.initialize_app(config)
auth = firebase.auth()
firedb = firebase.database()

I am creating this dictionary

userInfo = {"email": email, "password": password, "stripeID":, "subscriptionID": subID,"subscription": "active", "startdate": "Today bro"}

And passing it into my into my set function that is suppose to (or at least I thought it did) save my JSON object into the Firebase Database.


I am trying to store users under “users” and then categorize them all with a custom key being their localId.

For some reason everytime, I hit hit the line of code above, I get an error saying this

requests.exceptions.HTTPError: [Errno 401 Client Error: Unauthorized for url:] {
  "error" : "Permission denied"

These are my database rules in firebase

enter image description here

Is there something I am missing? I have even gone a step further to remove all rules so anyone can access it and I have also put in dummy data just to see if it works. Dummy data is possible because I am manually entering in all the information.

1 Answers
Best Answer
AvatarMatthias answered 4 months ago
Your Answer

13 + 15 =

Popular Tags

WP Facebook Auto Publish Powered By :