是火力用户ID唯一每提供商(Facebook,微博,密码) [英] is firebase user id unique per provider (facebook, twitter, password)

查看:104
本文介绍了是火力用户ID唯一每提供商(Facebook,微博,密码)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果允许多个火力点AUTH提供商(推特,脸谱,密码),它是最好的存储用户以这种方式:

If allowing multiple auth providers in firebase (twitter, facebook, password), is it best to store users in this manner:

/用户/ [auth.id] _ [auth.provider] / ...

/users/[auth.id]_[auth.provider]/...

它看起来像有可能是基于对供应商在auth.id重叠。

It looks like there could be overlap in auth.id based on the provider.

大多数例子有安全文件只检查auth.id.我试图避免创造我自己的用户ID的复杂性。

Most of the examples have the security file only checking auth.id. I'm attempting to avoid the complexity of creating my own user ids.

思考?

推荐答案

是,如果你使用的是与简单登录多个身份验证提供者,它的建议,以preFIX或与供应商后缀他们,因为你有。 auth.id 只能保证是同一供应商中是唯一的。

Yes, if you're using multiple auth providers with Simple Login, it's recommended to prefix or suffix them with the provider, as you have. auth.id is only guaranteed to be unique within the same provider.

火力地堡现在提供了一个 UID 参数auth对象,这是保证在供应商唯一的。例如,看到任何一个简单的登录供应商,如的电子邮件/密码

Firebase now provides a uid parameter on the auth object, which is guaranteed to be unique across providers. For example, see "After Authenticating" on any of the simple login providers, such as email/password

这篇关于是火力用户ID唯一每提供商(Facebook,微博,密码)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆