如何限制注册到Firebase中的产品 [英] How do I restrict signup to a product in Firebase

查看:122
本文介绍了如何限制注册到Firebase中的产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我创建一个新产品,使用简单的认证,那么有一个创建用户API。如何限制它,以便只有受邀电子邮件(通过电子邮件或通过一次性密钥)才能注册?似乎并不容易进入规则,但我可能会错过一些东西。

首先,我应该指出核心Firebase API使用JSON Web Tokens进行身份验证,您可以自行生成身份验证,因此您可以完全控制用户帐户的创建,并且可以对其进行限制:



https://www.firebase.com/docs/security/custom-login。



我猜你是指我们的简单登录服务。



简单登录是一项提供一些常用登录选项的服务。没有办法限制新帐户的创建。不过,您可以通过Firebase限制这些帐户可以执行的操作。例如,您可以设置您的安全规则,以便只有某些授权列表(Firebase中)的用户帐户才能读取或写入数据。


If I create a new product, use simple auth, there is a "create user" API. How do I restrict it so that only invited emails (either by the email or via a one-time key) can sign up? Doesn't seem to fit easily into the rules, but I am probably missing something.

解决方案

First, I should point out that the core Firebase API uses JSON Web Tokens for auth, which you can generate yourself, so you have full control over the creation of user accounts and can restrict it however you like:

https://www.firebase.com/docs/security/custom-login.html

I'm guessing you're referring to our Simple Login service.

Simple Login is a service that provides some common login options. It has no way to restrict creation of new accounts. However, you can restrict what those accounts can do with Firebase. For example, you could set your security rules up so that only user accounts in some authorized list (in Firebase) are actually able to read or write data.

这篇关于如何限制注册到Firebase中的产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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