微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何将加盐的 MD5 密码从 Spring Security 3.x 迁移到 5.x?

如何解决如何将加盐的 MD5 密码从 Spring Security 3.x 迁移到 5.x?

我有一个配置了 Spring Security 的 Spring 3 项目,想迁移到最新的 Spring Security 5.4.6。 在我的旧应用程序中,我使用 Spring 3 的 MD5 加盐解决方案(使用用户名)将散列/加盐密码存储在我的数据库中。即使 Spring Security 5 offers facility to migrate existing MD5 hashed passwords,(例如在数据库中使用 {md5} 为所有散列密码添加前缀以与新的 DelegatingPasswordEncoder 一起使用),它也不提供迁移 MD5 salted 密码的功能...>

这是我的实际安全配置:

<s:authentication-manager>
<s:authentication-provider>

<s:password-encoder hash="md5"><s:salt-source user-property="username"></s:salt-source></s:password-encoder>
    
</s:authentication-provider>
</s:authentication-manager>

我的问题是:如何使用相同的配置迁移到 Spring Security 5,而不为我的用户重新生成新密码?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。