node.js - Firebase Admin SDK - 创建没有密码的用户是否安全?

标签 node.js firebase firebase-authentication firebase-admin

我正在 Firebase Web 应用程序上管理自己的电子邮件登录,因此我发送验证电子邮件并在云函数中创建经过身份验证的用户。以下是我目前创建新用户的方式:

const admin = require('firebase-admin')
admin.initializeApp()

... 

userRecord = await admin.auth().createUser({
  email: signInData.email,
  emailVerified: true
}) 

我希望将其设置为用户永远不会以任何方式创建、重置或管理密码。他们只能请求登录电子邮件。

The docs假设创建新用户时所有属性都是可选的:

Note: All of the above properties are optional. If a certain property is not specified, the value for that property will be empty unless a default is mentioned in the above table.

我不向用户提供重置密码的方法,因此将用户密码留空是否存在风险?

最佳答案

没有风险。事实上,无密码登录似乎更安全,因为用户不存在使用某些常见弱密码或将其写入某处的风险。此外,用户必须有权访问其电子邮件才能登录,因此除非他们与某人共享电子邮件或电子邮件遭到泄露,否则该帐户是安全的。

有一个关于 Is passwordless authentication more secure than passwords? 的博客。我建议您阅读该内容以获取详细信息。

关于node.js - Firebase Admin SDK - 创建没有密码的用户是否安全?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68415984/

相关文章:

android - 如何从 Android 应用程序中删除 firebase 身份验证用户?

javascript - 阿多尼斯 5.0 TypeError : Cannot read property 'length' of undefined

javascript - 是否可以验证单个路由参数?

ios - 具有不同数组的每个文本字段的 UIPickerView (Swift/Firebase)

Android - Firebase 用户身份验证 token 会过期吗?

reactjs - FirebaseUI react : allow user to sign up via email+password without providing their first/last name

node.js - socket.io Angular 错误: Uncaught TypeError: Cannot call method 'onClose' of null

node.js - 全栈 Angular 和meanjs之间的区别

android - 如何在 View Holder 上的 OnClick Adapter 中不获取 null 的情况下获取 AdapterPositions?

node.js - Firestore : Different rules for creating and updating documents