from firebase import firebase as fb
auth = fb.FirebaseAuthentication('<firebase secret>', 'm...@gmail.com', auth_payload={'uid': '<uid>'}) // NB renamed extras -> auth_payload, id -> uid here
firebase = fb.FirebaseApplication('https://<url>.firebaseio.com', authentication=auth)
result = firebase.get('/users', name=None, connection=None, params={'print': 'pretty'}) // HTTPError: 401 Client Error: Unauthorized
print result
I keep getting (401) Unauthorized, but I notice that the token generated by the library is radically different to one generated by a JavaScript version of FirebaseTokenGenerator - and the latter authenticates fine when I provide the same URL, uid and secret.
I noticed a GitHub issue, questioning why the library did not just use the official Python firebase-token-generator, so I forked and implemented the suggested change just in case it would make a difference, but still get the same result.
Can anyone suggest what might be tripping me up here? Possible my Python crypto libraries setup is somehow incompatible (I am using Anaconda)?
Cross-post from StackOverflow.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/10cc3ba1-0ee3-45d9-b6b3-558164bb44b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
auth = fb.FirebaseAuthentication('pwd', 'email', auth_payload="None")
firebase = fb.FirebaseApplication('https://stapp-48d1b.firebaseio.com', authentication=auth)
method B
def auth_with_password(self, email, password):
request_ref = 'https://auth.firebase.com/auth/firebase?firebase={0}&email={1}&password={2}'.\
format(self.fire_base_name, email, password)
request_object = self.requests.get(request_ref)
return request_object.json()Please illustrate? Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/7527b924-18a9-49f6-8511-abdcd1c1278a%40googlegroups.com.