OpenFIRE:无洪水加密的SHA-1密码
题
我希望能够创建具有直接升高SHA-1密码的用户。没有吹鱼,没什么特别的,只有普通的老香草sha-1。到目前为止,我能够实现这一目标的唯一方法就是扩展默认情况下的默认设备并覆盖创建器,从而进行以下更改:
if (!usePlainPassword) {
try {
encryptedPassword = StringUtils.hash(password.getBytes(),"SHA-1");
// encryptedPassword = AuthFactory.encryptPassword(password);
// Set password to null so that it's inserted that way.
password = null;
} catch (UnsupportedOperationException uoe) {
// Encrypting the password may have failed if in setup mode.
// Therefore, use the plain password.
}
}
有一个更好的方法吗?想法?建议?
(此“要求”的原因是我正在尝试访问 ofUser
通过mod_auth_mysql表,以便我可以为项目的所有不同区域(例如颠覆)提供“单个符号”解决方案。)
解决方案
事实证明,我的初始解决方案(在问题中提供)是完成此功能的唯一方法。我在OpenFire支持论坛上与其他人交谈,他们同意。
不隶属于 StackOverflow