1

I am a beginer with raspberrypi and I am currently working on it and want to upload files to firebase.
I have tried using pyrebase to upload data to firebase .
The code I have used is

import pyrebase
config = {
"apiKey": "AIzaSyDQIr6KCJTROzrAs8x9YvSSFo5zZ06N",
"authDomain": "achyuth13451601.firebaseapp.com",
"databaseURL": "https://achyuth13451601.firebaseio.com",
"storageBucket": "achyuth13451601.appspot.com",
}
firebase = pyrebase.initialize_app(config)
auth = firebase.auth()
user = auth.sign_in_with_email_and_password(email, password)
db = firebase.database()
data = {
    "name": "Mortimer 'Morty' Smith"
}
results = db.child("users").push(data, user['idToken'])

but I am getting an error that unauthorized for url and permission denied

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Achyuth
  • 11
  • 3

1 Answers1

0

Firebase uses firebase security rules to check if you are allowed to have access to any data or files. Firebase rules exist for both the databases (realtime, cloud) and firebase storage which you are using. By default firebase storage security rules don't allow to upload files. You must go to your firebase storage console and check them and change them to fit your needs.

Chris Papantonis
  • 720
  • 7
  • 18