在 Grails 3.0 中,如何指定 Spring Boot Security 应该使用BCrypt进行密码编码?
以下几行应该提供我认为需要做的事情的感觉(但我大多只是猜测):
import org.springframework.security.crypto.password.PasswordEncoder
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
PasswordEncoder passwordEncoder
passwordEncoder(BCryptPasswordEncoder)
spring-boot-starter-security
我的应用程序作为依赖项加载:
构建.gradle
dependencies {
...
compile "org.springframework.boot:spring-boot-starter-security"
我有一项服务可以userDetailsService
使用:
conf/spring/resources.groovy
import com.example.GormUserDetailsService
import com.example.SecurityConfig
beans = {
webSecurityConfiguration(SecurityConfig)
userDetailsService(GormUserDetailsService)
}