@Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { UsernamePasswordToken upToken = (UsernamePasswordToken) token; User user = userDAO.getUserByUsername(upToken.getUsername()); if (user == null) { throw new AuthenticationException("Login name [" + upToken.getUsername() + "] not found!"); } return new SimpleAuthenticationInfo(user, user.getPassword(), getName()); }