Java Grails spring安全插件默认使用不推荐的PasswordEncoder吗?
我使用的是spring安全插件2.0-RC2 我试图使用Java Grails spring安全插件默认使用不推荐的PasswordEncoder吗?,java,grails,spring-security,Java,Grails,Spring Security,我使用的是spring安全插件2.0-RC2 我试图使用org.springframework.security.crypto.password.PasswordEncoder,因为org.springframework.security.authentication.encoding.PasswordEncoder已经被弃用 但是正在连接的BCryptPasswordEncoder实现了不推荐的一个。我只是想知道插件是否仍然默认使用旧的实现 我在SpringSecurityCoreGrails
org.springframework.security.crypto.password.PasswordEncoder
,因为org.springframework.security.authentication.encoding.PasswordEncoder
已经被弃用
但是正在连接的BCryptPasswordEncoder实现了不推荐的一个。我只是想知道插件是否仍然默认使用旧的实现
我在SpringSecurityCoreGrailsPlugin.groovy中看到了以下几行:
/** passwordEncoder */
if (conf.password.algorithm == 'bcrypt') {
passwordEncoder(BCryptPasswordEncoder, conf.password.bcrypt.logrounds) // 10
}
else if (conf.password.algorithm == 'pbkdf2') {
passwordEncoder(PBKDF2PasswordEncoder)
}
else {
passwordEncoder(MessageDigestPasswordEncoder, conf.password.algorithm) {
encodeHashAsBase64 = conf.password.encodeHashAsBase64 // false
iterations = conf.password.hash.iterations // 10000
}
}
不推荐使用的接口的所有实现。我是否必须创建我自己的新编码器bean,还是我遗漏了什么?是的。插件的作者正在使用最新的一个。那么,在此期间,我们是否需要使用不推荐的编码器?使用不推荐的编码器你会遇到任何障碍吗?不太可能,我只是认为它被弃用肯定有一个很好的原因。我刚刚发现插件有一个弃用的passwordEncoder的实现,它有一个编码器委托来实现新的passwordEncoder接口。所以,我想这是他们使用新编码器的方式。不过,您必须使用BCrypt。