Reference validationURL = new Reference(casServerURL + "proxyValidate");
validationURL.addQueryParameter("service", getServiceURL(request));
validationURL.addQueryParameter("ticket", serviceTicket);
validationURL.addQueryParameter("pgtUrl", getServiceURL(request));
ClientResource serviceValidate = new ClientResource(validationURL);
try {
Representation validationResult = serviceValidate.get();
ServiceResponse serviceResponse = ServiceResponseParser.parse(validationResult.getStream());
if (serviceResponse instanceof AuthSuccess) {
AuthSuccess authSuccess = (AuthSuccess)serviceResponse;
request.getClientInfo().setUser(new User(authSuccess.getUser()));