NutzCN Logo
问答 nutzwk中shiro配置的属性sha256Matcher.storedCredentialsHexEncoded从false改为true是不是就登陆不进去了?
发布于 2007天前 作者 qq_64f81159 3208 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk
sha256Matcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher
sha256Matcher.storedCredentialsHexEncoded = false
sha256Matcher.hashIterations = 1024
sha256Matcher.hashSalted = true

这个加密算法storedCredentialsHexEncoded把false改为true就没办法登陆了,至于要改的原因是因为报了一个

org.apache.shiro.crypto.CryptoException: Unable to execute 'doFinal' with cipher instance
 

错误,别个推荐的做法是把这个改为true,我改了就登陆失败了。。

2 回复

看起来像4.x
ehcache缓存、redis缓存 清空后 重启试试

上面回答不对,你应该像5.x版本那样,把所有计算用户密码的地方,把:

new Sha256Hash("1", salt, 1024).toBase64();

改成:

new Sha256Hash("1",ByteSource.Util.bytes(s), 1024).toHex()
添加回复
请先登陆
回到顶部