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()));
logger.debug("Validated CAS-ticket for user '{}'", authSuccess.getUser());
if (authSuccess.getProxyGrantingTicket() != null) {
String pgtId = pgtIouMap.remove(authSuccess.getProxyGrantingTicket());
if (pgtId != null) {
ProxyGrantingTicketRegistry.storeProxyGrantingTicket(pgtId);
}
else {
logger.warn("pgtIou mapping missing for validated user '{}'", authSuccess.getUser());
}
}
return true;
}