まっすぐな SHA-1 パスワードを持つユーザーを作成できるようにしたいと考えています。Blowfish も特別なものも何もなく、単純な古いバニラ SHA-1 だけです。これまでにこれを達成できた唯一の方法は、DefaultUserProvider を拡張して createUser をオーバーライドし、次の変更を加えることでした。
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
、Subversion などのプロジェクトのさまざまな領域すべてに対して「シングル サインオン」ソリューションを使用できるように、mod_auth_mysql を介してテーブルにアクセスしようとしているからです。)