}
String givenPassword = ((Password) credentials).getValue();
if (ObjectUtils.notEqual(givenPassword, actualPassword)) {
throw new AuthenticationException("wrong password");
}
Authentication authentication = new Authentication(username);
return authentication;
}