对Firebase Auth帐户实施密码的自定义规则 [英] Enforce custom rules for passwords for Firebase Auth accounts

查看:82
本文介绍了对Firebase Auth帐户实施密码的自定义规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户创建帐户时,有什么方法可以设置密码的自定义规则?好像Firebase没有提供编辑密码规则的方法.我知道我可以在前端设置密码规则,但是就像提到的 Frank van Puffelen 一样,可以直接绕过此方法调用API.是否可以编写一些云函数来处理帐户创建请求,如果密码无效,则拒绝该请求?

Is there any way that I could set custom rules for passwords when a user create an account? It seems like firebase doesn't provide a way to edit the password rules. I know I can set password rules on front end, but just like Frank van Puffelen mentioned, this method can be bypassed by directly calling the API. Is is possible to write some cloud function to handle account-creation request, and reject the request if the password is invalid?

推荐答案

当然,您可以编写一个Cloud Function来创建电子邮件/密码帐户.您需要使用管理SDK 来保留用户管理API .

Sure, you can write a Cloud Function to create email/password accounts. You'll need to use the Admin SDK to get a hold of user management APIs.

这篇关于对Firebase Auth帐户实施密码的自定义规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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