请教我 Firebase 身份验证的 uid
我正在考虑为两个应用程序使用相同的 Firebase 项目。
我们计划使用 Firebase 身份验证来实现社交登录。
我在这里有一个问题。 假设这两个应用分别是 A_app 和 B_app,并且每个应用都有一个使用 Firebase 身份验证的 Google 登录实现。
在本例中,用户在 A_app 中使用 Google Login 注册为会员。 然后,向新用户颁发UID。
接下来,同一用户尝试在 B_app 中使用 Google 登录进行注册。 然后,同一用户尝试在 B_app 中使用 Google 登录进行注册。既然他已经在A_app中注册了相同的Google帐户,那么他会立即在B_app中登录吗? 如果发生这种情况,我们是否需要设计成用户必须在 B_app 中以与 A_app 中不同的方式注册?
即使设备相同,Firebase 身份验证中是否有任何方法可以通过应用 ID 或其他方式识别它们并颁发单独的 UID?
如果您能告诉我,我将不胜感激。
I'm thinking of using the same Firebase project for two apps.
We are planning to use Firebase Authentication to implement social login.
I have one question here.
Let's say the two apps are A_app and B_app respectively, and each has a Google login implementation using Firebase Authentication.
In this case, a user registers as a member using Google Login in A_app.
Then, a UID is issued to the new user.
Next, the same user tries to sign up with Google login in B_app.
Then the same user tries to sign up with Google login in B_app. Since he has already signed up with the same Google account in A_app, will he be logged in immediately in B_app?
If that happens, do we need to design it so that the user has to register in a different way in B_app than in A_app?
Even if the devices are the same, is there any way in Firebase Authentication to identify them by app ID or other means and issue individual UIDs?
I would appreciate it if you could tell me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,会的。
不,没有必要做一些特别的事情。
不,Firebase 身份验证与用户执行身份验证的设备没有任何关系。但是,如果您需要根据用户使用的设备来识别用户,那么您应该考虑将用户数据与设备 ID 一起保存在 Cloud Firestore 或实时数据库 。如果您还需要一些限制,也请考虑使用安全规则。
Yes, it will.
No, there is no need for doing something special.
No, Firebase Authentication it's not related in any way to the device on which the user performs the authentication. If you need, however, to identify the users according to the device they are using, then you should consider saving user data along with the device ID, either in Cloud Firestore or in the Realtime Database. If you also need to have some constrains, please also consider using Security Rules.