How does Firebase generate the Uid?

与世无争的帅哥 提交于 2019-12-07 04:44:28

问题


My question is how does Firebase generate the Uid? Is it generated from the app installation on the cellphone or maybe it is based on the login provider via email, Facebook, Google or the other ones that Firebase provide?


回答1:


The Firebase User ID (often called uid) is an opaque identifier for a user account. It has no connection to the underlying identity provider(s) for the account and should be treated as an opaque value.




回答2:


UUID is autogenerated based on timestamp and some entropy. UUID's can be sorted based on creation time, this helps to maintain indexes in Firebase.

UUID is not some hash of for example the email address, or facebook id or other. By removing all meaning from the uid itself, it is not dependent on any underlying properties and those properties can freely changed.

If you want to use custom UID you need to be consistent. It is recommended to not tight together user id creation and login property of some sort because the property can change, and you will have inconsistent user id.



来源:https://stackoverflow.com/questions/38760612/how-does-firebase-generate-the-uid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!