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

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

问题描述

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

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?

我应该使用返回的用户 ID 并在 Firebase 中创建我自己的用户对象,还是不需要重复.我确实需要添加一些额外的用户属性,所以也许我无论如何都需要这样做.

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.

推荐答案

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

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.

Firebase 中的数据与用户的电子邮件/密码哈希组合之间的这种障碍是有意为之:我们希望让您更轻松地 (1) 开发您的应用程序,(2) 防止任何意外的用户凭据泄露,(3) 在如何在 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.

这意味着我们只存储电子邮件地址/密码哈希组合而不存储其他任何东西,因此由您决定如何在 Firebase 中存储实际用户数据.正如您所建议的,您应该获取用户 ID 并将该数据存储在 Firebase 中的/users/$id 等位置,并使用 Firebase Security Rules Language 以确定对该数据的读/写访问权限.您用户的唯一 idemail 已经在您编写规则时使用的 auth 变量中.

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天全站免登陆