且构网

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

如何在不登录的情况下通过 Firebase 身份验证创建新用户?

更新时间:2023-09-10 15:11:40

这是Firebase 管理 SDK.您不是在客户端创建用户,而是在托管环境中创建用户,例如服务器或 Cloud Functions.当您想要添加新用户时,您让客户端调用您的端点.此 codelab 展示了如何使用 Firebase Admin Auth SDK 合并自定义声明.这与您正在寻找的内容略有不同,但它可以让您朝着正确的方向开始.

This is a good use case for the Firebase Admin SDKs. Instead of creating the user client-side, you create the user in a managed environment, like a server or Cloud Functions. You have the client make a call to your endpoint when you want to add a new user. This codelab shows how to incorporate custom claims using the Firebase Admin Auth SDK. This is a little different from what you're exactly looking for, but it can get you started in the right direction.