this.casServerURL = casServerURL;
}
@Override
protected int beforeHandle(Request request, Response response) {
Form queryParams = new Form(request.getResourceRef().getQuery());
String serviceTicket = queryParams.getFirstValue("ticket");
if (serviceTicket != null) {
// Try to authenticate against CAS
boolean success = validateServiceTicket(serviceTicket, request, response);
return success ? Filter.CONTINUE : Filter.SKIP;
}
String pgtId = queryParams.getFirstValue("pgtId");
String pgtIou = queryParams.getFirstValue("pgtIou");
if (pgtId != null && pgtIou != null) {
// FIXME: clean up the hash map once in a while
pgtIouMap.put(pgtIou, pgtId);
response.setStatus(Status.SUCCESS_OK);
response.setEntity(new StringRepresentation("bla"));