我正在将Spring Security与bcrypt一起用于密码安全性。
它实际上在Grails应用程序中。当应用程序启动时,我得到:
“没有这样的算法[bcrypt]”
我将错误跟踪到Spring安全性中的代码:
try {
return MessageDigest.getInstance(algorithm);
}
catch (NoSuchAlgorithmException e) {
throw new IllegalArgumentException("No such algorithm [" + algorithm + "]");
}
如何将bcrypt安装到Java Security中?
我正在CentOS 7上运行Oracle JDK 1.8.0_73-b02。
最佳答案
问题是代码:
messageDigestPasswordEncoder(MessageDigestPasswordEncoder, conf.password.algorithm) {
encodeHashAsBase64 = conf.password.encodeHashAsBase64
iterations = conf.password.hash.iterations
}
默认情况下,Grails 3 spring-core插件配置conf.password.algorithm =“bcrypt”
我以为我已经在配置中覆盖了它,但是那是在Config.groovy中。在grails中,需要将3配置移到application.groovy
关于java - 没有这样的算法-bcrypt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35644181/