将 Wordpress 用户导入 Firebase 身份验证
Importing Wordpress Users into Firebase authentication
我正在将我的 Wordpress 网站迁移到 Firebase。我已成功将我的 Wordpress 用户导出为以下 JSON 格式(如 the documentation 中所述)
我相信 WordPress 使用 MD5,但我很难将 WordPress 密码导入 Firebase。我不确定 passwordHash 值需要是多少?有人知道吗?
{
"users": [
{
"localId": "11",
"passwordHash": "",
"email": "test@icloud.com",
"createdAt": "1515666546293",
"displayName": "test name"
}
]
}
WordPress 不再使用 MD5。根据this answer it now implements Portable PHP password hashing framework. Although other posts (like this one for example) claim that it uses Blowfish.
在 passwordHash
字段下,您必须设置从 WordPress 获得的散列密码(例如 $P$BXb4SCf11vB9pPFJFbkDLzDqVq89ra/
)。导入数据时在 Firebase CLI 上指定哈希算法:
firebase auth:import users.json --hash-algo=BCRYPT
请注意,我使用了 BCRYPT 作为哈希算法。那是因为it is based on Blowfish。我不能保证 Firebase Auth 会识别这些 WordPress 密码。
如果没有,那么我建议您导入帐户,在 passwordHash
字段下传递一个随机字符串,然后 email your users 说明您的网站正在经历迁移过程因此,他们将需要在再次登录之前重置密码。
我正在将我的 Wordpress 网站迁移到 Firebase。我已成功将我的 Wordpress 用户导出为以下 JSON 格式(如 the documentation 中所述)
我相信 WordPress 使用 MD5,但我很难将 WordPress 密码导入 Firebase。我不确定 passwordHash 值需要是多少?有人知道吗?
{
"users": [
{
"localId": "11",
"passwordHash": "",
"email": "test@icloud.com",
"createdAt": "1515666546293",
"displayName": "test name"
}
]
}
WordPress 不再使用 MD5。根据this answer it now implements Portable PHP password hashing framework. Although other posts (like this one for example) claim that it uses Blowfish.
在 passwordHash
字段下,您必须设置从 WordPress 获得的散列密码(例如 $P$BXb4SCf11vB9pPFJFbkDLzDqVq89ra/
)。导入数据时在 Firebase CLI 上指定哈希算法:
firebase auth:import users.json --hash-algo=BCRYPT
请注意,我使用了 BCRYPT 作为哈希算法。那是因为it is based on Blowfish。我不能保证 Firebase Auth 会识别这些 WordPress 密码。
如果没有,那么我建议您导入帐户,在 passwordHash
字段下传递一个随机字符串,然后 email your users 说明您的网站正在经历迁移过程因此,他们将需要在再次登录之前重置密码。