问题描述
我想在我的grails项目中使用bcrypt哈希算法,而不是它的defaultSHA-256消息摘要算法。要启用bcrypt,您只需使用 grails install-plugin spring-security-bcrypt
命令。
I want to use bcrypt hashing algorithm in my grails project instead of its defaultSHA-256 message digest algorithm. To enable bcrypt, you just use the grails install-plugin spring-security-bcrypt
command.
您可以自定义通过将它添加到 BuildConfig.groovy
:
You can customize keying rounds by adding this to BuildConfig.groovy
:
grails.plugins.springsecurity.password.bcrypt.logrounds = 15
我的问题是,我需要做什么将bcrypt设置为我的密码算法?当我从spring-security-core生成的域类中使用此方法时,它是否自动使用bcrypt算法:
My question is, is that all I need to do to set bcrypt as my password algorithm? Does it automatically use the bcrypt algorithm when I use this method from the domain class generated by spring-security-core:
springSecurityService.encodePassword(params.password)
如何检查bcrypt是否适用于我的项目?
How do I check if bcrypt is working on my project?
推荐答案
您还需要添加
You also need to add
grails.plugins.springsecurity.password.algorithm='bcrypt'
这篇关于使用spring-security-bcrypt插件在Grails中加密集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!