0

I'm using Pyrebase to fetch data from firebase in Django and so far it seems to be able to do everything but for some reason, I can't fetch the User UID from the authentication page in firebase. enter image description here This is necessary for me to be able to do as all my user database nodes are save under the User UID from here. Here is my current attempt but the idToken doesn't return the User UID

  token = user['idToken']

  print(token)
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
user
  • 345
  • 2
  • 8
  • 32

1 Answers1

1

I figured it out. Once authenticated you can call localId which will fetch the user UID.

user = auth.sign_in_with_email_and_password(email, password)

session_id = user['idToken'
request.session['uid'] = str(session_id)

print(user["localId"])
user
  • 345
  • 2
  • 8
  • 32