}
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
//
ProjectUserService projectUserService = beanFactory.getBean(ProjectUserService.class);
UsernamePasswordToken usernamePasswordToken = (UsernamePasswordToken) token;
Assert.hasText(usernamePasswordToken.getUsername(), "Username can not be null!");
ProjectUser projectUser = projectUserService.getProjectUser(usernamePasswordToken.getUsername());
//
Assert.notNull(projectUser,String.format("User not found for username %s", usernamePasswordToken.getUsername()));
//
return new SimpleAuthenticationInfo(projectUser.getUsername(), projectUser.getPassword(), REALM_NAME);
}