Ich verwende den folgenden Code, um Daten von Firebase auf Raspberry Pi abzurufen, aber es zeigt folgenden Fehler. Ich kann jedoch Daten ohne Authentifizierung abrufen.'FirebaseApplication' Objekt hat kein Attribut 'Authentifizierung'
from firebase.firebase import FirebaseApplication
from firebase.firebase import FirebaseAuthentication
firebase = firebase.FirebaseApplication('https://myapp.firebaseio.com/',
authentication =None)
authentication = firebase.Authentication('secretkey',
'[email protected]', extra={'id': 123})
firebase.authentication = authentication
print (authentication.extra)
user = authentication.get_user()
print (user.firebase_auth_token)
result = firebase.get('/messages', None)
es zeigt folgende Fehler
Traceback (most recent call last):
File "/home/pi/code/dataauth.py", line 7, in authentication = firebase.Authentication('secretkey', '[email protected]', extra={'id': 123}) AttributeError: 'FirebaseApplication' object has no attribute 'Authentication'
Ich bin in der Lage Daten ohne Authentifizierung zu holen dh Regeln auf true setzen, durch den Code folgenden
from firebase.firebase import FirebaseApplication
firebase = firebase.FirebaseApplication('https://myapp.firebaseio.com/',
None)
result = firebase.get('/messages', None)