如何访问Firebase身份验证部分 [英] How to get access to the firebase Authentication part

查看:47
本文介绍了如何访问Firebase身份验证部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我有2种登录方法(google& facebook),所有用户都显示在firebase项目内的Authentication部分中,并且我没有在数据库中列出/收集用户.

In my app I've 2 login methods(google&facebook) and all the users appear in the Authentication part inside my firebase project, and I haven't list/collection of my users in my database.

我想在我的应用程序列表中显示一些个人数据.

I want to display in my app list of users with some personal data.

我的问题是我如何从身份验证部分访问用户(例如,获取所有用户)?

My question is how do i get access to the users from the Authentication part(to get all the users for example)?

用户仅出现在Authentication中而不出现在我的数据库中是一种好方法吗?

Is it good approach that the users appear only in the Authentication and not inside my database?

推荐答案

您无法使用Firebase身份验证客户端SDK列出用户帐户.您只能使用自己控制的后端上的Firebase Admin SDK来做到这一点.

You can't list user accounts with the Firebase Authentication client SDK. You can only do that with the Firebase Admin SDK on a backend you control.

如果您认为用户可以认识所有其他用户,则应该将该信息存储在数据库中,以使其可以直接从客户端查询,或者创建某种API终结点,您可以在其中调用您应用中的管理SDK.

If you think it's OK for your users to be able to know all other users, then you should store that information in your database to make it queryable directly from the client, or create some sort of API endpoint where you can invoke the Admin SDK from your app.

这篇关于如何访问Firebase身份验证部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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