public static void encodPassword(User user) {
LOGGER.debug("Encodage du password");
// Encodage du passord et salt;
UserDetailsAdapter userDetails = new UserDetailsAdapter(user); // 1
String password = userDetails.getPassword();
ReflectionSaltSource saltSource = new ReflectionSaltSource();
saltSource.setUserPropertyToUse("username");
Object salt = saltSource.getSalt(userDetails); // 2
user.setPassword((new ShaPasswordEncoder()).encodePassword(password, salt)); // 3
}