是否可以启用Firebase电子邮件身份验证但可以禁用登录? [英] Is it possible to enable Firebase email authentication but disable sign in?

查看:65
本文介绍了是否可以启用Firebase电子邮件身份验证但可以禁用登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我已经在使用Firebase身份验证和Google帐户,但是我还想授权一些没有Google帐户的用户.因此,我想将它们从Firebase控制台手动添加到授权服务器,并启用电子邮件身份验证.

In my app, I'm already using the Firebase authentication with Google accounts, but I'd also like to authorize some users who have no Google account. So I'd like to manually add them to the authorized server from the firebase console and to enable the email authentication.

我不希望随机用户能够使用他们的电子邮件在我的应用程序上创建一个帐户.

What I don't want is random users to be able to create an account on my app with their email.

有可能吗?我没有找到禁用登录的参数...

Is it possible ? I didn't find a parameter to disable sign in...

推荐答案

我认为谁可以单独登录Firebase身份验证是不可能的.

I don't think this is possible who can sign in on an individual basis in Firebase Authentication.

通常每个人都可以登录或关闭Firebase.然后,您允许他们分别访问特定资源.

Typically sign in to Firebase is either open or closed for everyone. Then you allow them access to specific resources on an individual basis.

例如,您使用Firebase数据库或Cloud Firestore,可以通过在安全规则中包含已批准用户的白名单来控制访问.请参阅通过电子邮件限制Firebase用户

For example, you use the Firebase Database or Cloud Firestore you could control access by having a whitelist of approved users in your security rules. See Restrict Firebase users by email

或者,您可以在要授予访问权限的配置文件上设置自定义声明,并在安全规则中进行检查:

Alternatively, you can set a custom claim on the profiles that you want to grant access, and check that in your security rules: Firebase Authentication with whitelisted email addresses

这篇关于是否可以启用Firebase电子邮件身份验证但可以禁用登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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