且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firebase Auth-按自定义声明列出的用户

更新时间:2022-12-11 16:20:47

没有内置的API可以获取具有特定声明的所有用户的列表.

There is no built-in API to get a list of all users that have a specific claim.

个API,用于获取 Admin SDK中所有用户的列表.因此,您可以使用它,然后过滤具有您要查找的声明的用户.

There is an API to get a list of all users in the Admin SDK. So you could use that and then filter the users that have the claim you're looking for.

但是这种表现不会很出色.因此,如果列出具有特定声明的所有用户是您应用的常见用例,则您需要重新考虑对使用额外位置存储数据的担忧.复制数据以实现(良好执行)用例在NoSQL中非常普遍.

But performance of this will not be spectacular. So if listing all users with a specific claim is a common use-case for your app, you'll want to reconsider your concern about using an additional place to store the data. Duplicating data to achieve (well performing) use-cases is quite common in NoSQL.