Firebase管理员如何使用无密码登录创建用户? [英] Firebase admin how to create user with passwordless signin?

查看:102
本文介绍了Firebase管理员如何使用无密码登录创建用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看以下文档,以使用Node.js Firebase管理员SDK创建用户: https://firebase.google.com/docs/auth/admin/manage-users#create_a_user

I am looking at the following docs to create a user using the Node.js Firebase admin SDK: https://firebase.google.com/docs/auth/admin/manage-users#create_a_user

但是,我想创建一个使用无密码(电子邮件链接)登录而不是密码的用户.这可能吗?

However, I want to create a user with passwordless (email link) sign-in, not with a password. Is this possible?

如果我没有为用户指定密码怎么办?

What happens if I don't specify a password for the user?

我的网络应用当前使用无密码登录,因此可以正常工作.

My web-app currently uses passwordless signin, so it works normally.

推荐答案

我刚刚进行了测试并弄清楚了.如果您没有为用户设置密码,则该用户将没有为他们设置任何登录方法(除了通过admin SDK创建自定义令牌并以此登录).

I just tested and figured it out. If you don't set a password for the user, the user will not have any sign in methods set for them (asside from creating a custom token from the admin SDK and signing in with that).

但是,如果您随后向该用户发送电子邮件登录链接,并且他们通过该链接登录,则会将无密码方法添加到他们的帐户中.

However if you then send an email sign-in link for the user, and they sign in through the link, it will add the passwordless method to their account.

这篇关于Firebase管理员如何使用无密码登录创建用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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