/** * @param pwd pass cần check * @param pwdEncoder Md5PasswordEncoder, salt là userName * @return true nếu pass đúng, false nếu sai */ private boolean checkCredentials(String pwd, Md5PasswordEncoder pwdEncoder) { return pwdEncoder.isPasswordValid(password, pwd, userName); }
private void populateCredentials(String un, String newPwd, Md5PasswordEncoder pwdEncoder) { userName = un.trim(); password = pwdEncoder.encodePassword(newPwd, userName); }