UsernamePasswordToken upToken = (UsernamePasswordToken) token;
String username = upToken.getUsername();
// Null username is invalid
if (username == null) {
throw new AccountException("Null usernames are not allowed by this realm.");
}
String password = jsonDbService.getPassword(username);
return new SimpleAuthenticationInfo(username, password, this.getName());
}