| | |
| | | public Response build() { |
| | | MultivaluedMap<String, String> params = session.getContext().getUri().getQueryParameters(); |
| | | String service = params.getFirst(CASLoginProtocol.SERVICE_PARAM); |
| | | String pgtUrl = params.getFirst(CASLoginProtocol.PGTURL_PARAM); |
| | | String ticket = params.getFirst(CASLoginProtocol.TICKET_PARAM); |
| | | boolean renew = params.containsKey(CASLoginProtocol.RENEW_PARAM); |
| | | |
| | |
| | | checkRealm(); |
| | | checkClient(service); |
| | | |
| | | checkTicket(ticket, renew); |
| | | checkTicket(ticket, CASLoginProtocol.SERVICE_TICKET_PREFIX, renew); |
| | | |
| | | if (pgtUrl != null) createProxyGrant(pgtUrl); |
| | | |
| | | event.success(); |
| | | return successResponse(); |
| | |
| | | } |
| | | |
| | | protected Response successResponse() { |
| | | StringBuilder sb = new StringBuilder(RESPONSE_OK); |
| | | sb.append(clientSession.getUserSession().getUser().getUsername()); |
| | | sb.append("\n"); |
| | | return Response.ok(sb.toString()).type(MediaType.TEXT_PLAIN).build(); |
| | | String response = RESPONSE_OK + clientSession.getUserSession().getUser().getUsername() + "\n"; |
| | | return Response.ok(response).type(MediaType.TEXT_PLAIN).build(); |
| | | } |
| | | |
| | | protected Response errorResponse(CASValidationException e) { |