[英]How do I get the firebase current user id (uid) in python?
我需要獲取當前的用戶 ID。
在 Javascript 中,我使用它來獲取 id
uid = firebase.auth().currentUser.uid // uid= ABO0Xc2E6KSDodEhenICkXF371x1
我如何在python中獲取uid?
你沒有提到圖書館,但你所有的其他問題都在使用 Pyrebase,所以瀏覽一下文檔(你絕對應該閱讀)......
# Get a reference to the auth service
auth = firebase.auth()
# Log the user in
user = auth.sign_in_with_email_and_password(email, password)
# Get the user's idToken
token = user['idToken']
用戶 = auth.sign_in_with_email_and_password(email,password) 打印(用戶 ['localId'])
這將在輸出屏幕上顯示當前的 Firebase UID
這是無需登錄或注冊即可檢索用戶 ID 的代碼。
auth.current_user['localId']
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.