Open windgo opened 8 years ago
Hi, I'm having the same issue. Is there any fix or workaround available?
Thanks!
Same error for me
Did any one managed to figure out why this is happening ?
Hi, same error, any idea of how make it work?
Mine works now, this is what I did:
self.fbAuth = firebase.FirebaseAuthentication(<Firebase secret key>, None,
extra={"provider": "custom", "uid": "abc", "pwd": <firebase secret>})
self.fbRef = firebase.FirebaseApplication(<Firebase URL>, self.fbAuth)
Hi @ltejoles which sign-in providers did you enabled?
So, actually it works fine even like this, with all the sign-in provider disabled
authentication = FirebaseAuthentication('DATABASE_SECRET', None)
firebase = FirebaseApplication('URL', authentication)
I was erroneously using the "Web Api Key" under "General" tab, while the correct is the one in the "Database" tab. Morever here is explicetely stated
In addition, the provided email and password information is totally
useless and they never appear in the ``auth`` variable at the server.
Hi @niqdev where can i get DATABASE_SECRET key, is there in firebase console?
Hi @ShreedharHM under Project Settings, the second tab. The url should looks something like
https://console.firebase.google.com/project/YOUR_PROJECT_NAME/settings/database
After trying too many times, i decided to give up for "Ozgur" library.
You can simply use: https://github.com/firebase/firebase-token-generator-python
Combined with "requests" http://docs.python-requests.org/en/master/user/quickstart/
Here Are Code examples:
SECRET = "1234dfglkjetrjwiot24t24tkljw4tjklt4wt4" (your app secret in firebase) auth_payload = {"uid": "1", "auth_data": "foo", "other_auth_data": "bar"} options = { 'expires' : sys.maxint} token = create_token(SECRET, auth_payload, options)
JSON_TOKEN = '.json?auth=' + token URL = 'https://yourapp.firebaseio.com/' + ENV + '/yourDesiredPath' + JSON_TOKEN BASEURL = 'https://yourapp.firebaseio.com/' + ENV + '/yourDesiredPath/' GENERAL_COUNTER = 'https://yourapp.firebaseio.com/' + ENV + '/yourDesiredPath/someField' + JSON_TOKEN
resultPut = requests.put(GENERAL_COUNTER , data=json.dumps({'general':counter})) resultDelete = requests.delete(BASEURL + key + JSON_TOKEN , data={}, headers={})
I have found this much easier to maintain and handle
This answer was useful for me, I finded the secret database key reading that answer.
After I set a rule which allow some user to write to Firebase, a exception was thrown.
It is ok with the iOS SDK, but python will crash.
code:
the rule:
exception:
Traceback