UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username, password); authRequest.setDetails(new WebAuthenticationDetails(request));
UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username, password);  authRequest.setDetails(new WebAuthenticationDetails(request, false));
    public Authentication attemptAuthentication(HttpServletRequest request)        throws AuthenticationException {        String username = CAS_STATEFUL_IDENTIFIER;        String password = request.getParameter("ticket");        if (password == null) {            password = "";        }        UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username,                password);        authRequest.setDetails(new WebAuthenticationDetails(request));        return this.getAuthenticationManager().authenticate(authRequest);    }