在尝试使用FusionAuth注册用户时,用户在尝试使用FusionAuth进行身份验证时将无法再使用其密码。
散列后的密码如下:$2a$10$3sTYd6sHbHIsTO2jBiishOTmcvFS.bJ2X2lbIDO1w2o4MNXXXXXXX
导入代码(Kotlin格式)如下所示:
val response = client.register(null, RegistrationRequest(User().apply {
username = user.username
email = user.email
firstName = user.firstname
lastName = user.lastname
active = user.isActive
encryptionScheme = "bcrypt"
password = user.password // generated with BCrypt(10)
passwordChangeRequired = false
data.putAll(mapOf(
"mainMandant" to user.mainMandant?.mandantName,
"custodianMandants" to user.custodianMandants.joinToString { it.mandantName },
"technicalUser" to user.isTechnicalUser
))
}, UserRegistration().apply {
applicationId = myAppId
roles = extractUserRoles(user).toSortedSet()
preferredLanguages.add(Locale.GERMAN)
username = user.username
}, false, true))对于FusionAuth系统设置,“加密散列设置”被配置为使用“加盐加密”方案,并启用因子10和登录时重新散列。
如果可能,如何注册用户并允许重复使用现有密码?
发布于 2019-06-26 22:43:00
注册接口不接受哈希密码,此接口将假定password字段中提供的值为纯文本。
要使用现有的散列密码导入用户,您需要使用import API。https://fusionauth.io/docs/v1/tech/apis/users#import-users
导入用户后,如果启用re-hash at login,则下次登录时,密码哈希将更新为与系统配置中的配置值相匹配。
https://stackoverflow.com/questions/56766945
复制相似问题