如果我使用Firebase简单用户名和密码,如何返回用户列表?密码认证 [英] How do I return a list of users if I use the Firebase simple username & password authentication

查看:132
本文介绍了如果我使用Firebase简单用户名和密码,如何返回用户列表?密码认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知道我是否做错了,但使用这个api https://www.firebase.com/docs/security/simple-login-email-password.html 我可以成功创建一个用户 - 根据返回的消息,但我不能看到该用户在任何地方伪造控制台。你怎么知道用户注册?

我应该采取返回用户ID,并在Firebase中创建我自己的用户对象,或者是这种重复是不必要的。我需要添加一些额外的用户属性,所以我需要这样做。

在Firebase身份验证(以前称为Firebase SimpleLogin)中,您用户的电子邮件和密码组合将与实际存储在Firebase中的数据分开安全地存储。


$ b

在您的Firebase和您的用户的电子邮件/密码哈希组合是由设计:我们希望使您更容易(1)开发您的应用程序,(2)防止任何意外的用户凭证泄漏,(3)仍然给你总如何将您的用户数据存储在Firebase中。



这意味着我们只存储电子邮件地址/密码哈希组合,没有其他任何东西,所以您可以决定如何将实际的用户数据存储在您的Firebase中。正如您所建议的那样,您应该获取用户ID并将这些数据存储在您的Firebase中的/ users / $ id位置,然后使用Firebase 安全规则语言来确定对该数据的读/写访问。您的用户的唯一 id 电子邮件已经在 auth 在编写规则时你会用到这个变量。


Not sure if I am doing something wrong but using this api https://www.firebase.com/docs/security/simple-login-email-password.html I can successfully create a user - according to the return message, but I can not see that user anywhere in the Forge console. How do you know what users are registered?

Should I be taking the return user ID and creating my own user object in Firebase or is this duplication unnecessary. I do need to add some additional user properties so perhapes I will need to do this anyway.

解决方案

When using email / password authentication in Firebase Authentication (previously known as Firebase SimpleLogin), your user's email and password combination is securely stored separately from the data actually stored in your Firebase.

This barrier between the data in your Firebase and your users' email / password hash combinations is by design: we want to make it easier for you to (1) develop your application, (2) prevent any accidental user credential leaks, and (3) still give you total flexibility with how to store your user data in Firebase.

That means that we only store the email address / password hash combination and nothing else, so it is up to you to decide how to store actual user data in your Firebase. As you suggested, you should be taking the user id and storing that data in your Firebase in a location such as /users/$id, and using the Firebase Security Rules Language to determine read / write access to that data. Your user's unique id and email are already in the auth variable you'll use when writing rules.

这篇关于如果我使用Firebase简单用户名和密码,如何返回用户列表?密码认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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