简体   繁体   English

firebase 中的 UID 是否为每个用户自动创建/读取?

[英]is UID in firebase automatically created/read for each user?

I'm sorry if my question is basic question...如果我的问题是基本问题,我很抱歉......

is UID in firebase automatically created when we implement .setUid() at the first user sign-up account?当我们在第一个用户注册帐户中实施.setUid()时,会自动创建 firebase 中的 UID 吗? and if we are login to that user account and implement .getUid() , can we retrieve the same UID?如果我们登录到该用户帐户并执行.getUid() ,我们可以检索相同的 UID 吗?

I use Android Studio and Kotlin as programming language我使用 Android Studio 和 Kotlin 作为编程语言

No matter how you implement authentication on your app, firebase will automatically set a uid for each account created.无论您如何在您的应用程序上实现身份验证,firebase 都会自动为每个创建的帐户设置一个 uid。 If you go to the auth section of your firebase console and manually add an account, you will see on the right hand side a uid generated for that account.如果您 go 到您的 firebase 控制台的 auth 部分并手动添加一个帐户,您将在右侧看到为该帐户生成的 uid。

To reference this uid within your code the uid does not need to be stored in any database solution for the uid is attatched to the account within FirebaseAuth..要在您的代码中引用此 uid,uid 不需要存储在任何数据库解决方案中,因为 uid 已附加到 FirebaseAuth 中的帐户。

To pull the uid for reference once the user has signed in, first you need to set the auth global variable..要在用户登录后提取 uid 以供参考,首先需要设置 auth 全局变量。

private lateinit var auth: FirebaseAuth私人 lateinit var auth:FirebaseAuth

Then anywhere within the scope of your functions you can set your uid reference variable like this..然后在你的函数的 scope 中的任何地方你都可以像这样设置你的 uid 引用变量..

val myUid = FirebaseAuth.getInstance().currentUser.uid; val myUid = FirebaseAuth.getInstance().currentUser.uid;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 firebase 用户 UID 作为 id 创建 django 用户 - Create django user with firebase User UID as id Firebase 规则 - 如果用户的 uid 等于文档的字段值 userId,则允许读取 - Firebase rules - Allow read if user's uid equals document's field value userId Firebase:: 如果验证了另一个节点(用户/驱动程序节点)的 uid,则允许读写访问 - Firebase :: Allow read write access if the uid of another node (user/driver node) is verified Firebase 云函数获取用户 UID - Firebase cloud funtions get user UID 在 Flutter 中获取当前用户 uid 为 Firebase 的数据 - Fetch Firebase data with current user uid in Flutter 从 firebase 数据库 flutter 中的 uid 获取用户数据 - get user data from uid in firebase database flutter 在session存储中存储Firebase用户uid是漏洞吗? 在客户端浏览器上的 javascript - Is storing Firebase user uid in session storage a vulnerability ? In javascript on client browser 如何使用 Firebase 检索已登录用户的 UID 下的数据 - How do I retrieve data under UID for the signed in user with Firebase 如何将 user.uid 作为 id 的文档添加到 Firebase 中的集合中? - How to add a document with user.uid as id to a collection in Firebase? 当用户在 react js 中使用用户的 uid 创建帐户时,在 firebase 中添加一个新集合 - Add a new collection in firebase when the user create account using uid of user in react js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM