[英]How can I access the created date from firebase token for a user?
How can I access created on from the userRecord object for a firebase user?对于 firebase 用户,我如何访问从 userRecord object 创建的? What are the other details that can be accessed using uid/email?
可以使用 uid/email 访问的其他详细信息是什么? (using python)
(使用蟒蛇)
I tried the following code and able to retrieve the uid.我尝试了以下代码并能够检索 uid。
user_obj = auth.get_user_by_email(email)
uid=user_obj.uid
From the documentation on get_user_by_email
it seems that it returns a UserRecord
object .从
get_user_by_email
上的文档看来,它返回了一个UserRecord
object 。 This in turn contains a user_metadata
property that has a creation_timestamp
property .这又包含一个
user_metadata
属性,该属性具有creation_timestamp
属性。
So:所以:
user_obj.user_metadata.creation_timestamp
When signing up with firebase's password based auth, you are provided with email, password and other meta data.使用 firebase 的基于密码的身份验证进行注册时,会为您提供 email、密码和其他元数据。 You can get
creation_timestamp
from metadata See:您可以从元数据中获取
creation_timestamp
参见:
https://firebase.google.com/docs/reference/admin/python/firebase_admin.auth#firebase_admin.auth.UserMetadata https://firebase.google.com/docs/reference/admin/python/firebase_admin.auth#firebase_admin.auth.UserMetadata
https://firebase.google.com/docs/reference/admin/python/firebase_admin.auth#firebase_admin.auth.UserRecord https://firebase.google.com/docs/reference/admin/python/firebase_admin.auth#firebase_admin.auth.UserRecord
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.