简体   繁体   English

iOS Firebase Swift:一种使用Auth获取所有用户的方法

[英]iOS Firebase Swift: A way To Get All Users Using Auth

Is there a way to get all signed up users using FirebaseAuth. 有没有一种方法可以使用FirebaseAuth获取所有注册用户。 I know I can create users node and save users when they sign up, but I'm looking for a way to get users using something like Auth.getAllUsers since all I'm looking for is uid and displayName . 我知道我可以创建用户节点并在用户注册时保存用户,但是我正在寻找一种使用户使用Auth.getAllUsers类的Auth.getAllUsers因为我要寻找的只是uiddisplayName I'm using swift, so admin sdk seems not supporting it. 我正在使用swift,因此admin sdk似乎不支持它。

There is no client-side API to get a list of all users, which is why many developers write details about the users into a database (such as the Firebase Realtime Database, or Cloud Firestore). 没有客户端API可以获取所有用户的列表,这就是为什么许多开发人员将有关用户的详细信息写入数据库(例如Firebase Realtime Database或Cloud Firestore)的原因。

There is a server-side Admin SDK that allows listing all users. 有一个服务器端Admin SDK,可以列出所有用户。 See https://firebase.google.com/docs/auth/admin/manage-users#list_all_users 请参阅https://firebase.google.com/docs/auth/admin/manage-users#list_all_users

You can create a cloud function that returns the results of the Admin SDK list all users function. 您可以创建一个云函数,该函数返回Admin SDK 列表所有用户函数的结果。 Make sure that you remove any private data fields from the reply, though. 不过,请确保您从回复中删除所有私人数据字段。 The hashed password, salt, and providers are included in the data. 哈希密码,密码和提供程序包含在数据中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM