Request a Service Ticket via rest api

64 views
Skip to first unread message

Maksim Kopeyka

unread,
Oct 11, 2019, 6:29:47 PM10/11/19
to CAS Community
Hi Guys,

I'm trying to request a service ticket according to documentation https://apereo.github.io/cas/6.0.x/protocol/REST-Protocol.html#request-a-service-ticket
but I don't see it in the response however I see it in the log file and this ticket is validated without problems. How to obtain service ticket via rest api response?

In my case I send a POST request to my CAS http://10.131.30.55:8443/cas/v1/tickets/TGT-2-t-zrIbxxxxxxxxxxxxxxx with parameter service=http://www.example.com
and Content-Type=application/x-www-form-urlencoded

This is a response headers:
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Type: application/vnd.cas.services+yaml;charset=UTF-8
Content-Length: 0
Date: Fri, 11 Oct 2019 22:19:54 GMT
Server: Apereo CAS

This is a log file:
2019-10-11 22:19:54,030 INFO [org.apereo.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: gsi
WHAT: ST-1-l6udFD0OXHBYplF91h--lXRnVdY8d63a7ebd424 for http://www.example.com
ACTION: SERVICE_TICKET_CREATED
APPLICATION: CAS
WHEN: Fri Oct 11 22:19:54 UTC 2019
CLIENT IP ADDRESS: 10.85.189.191
SERVER IP ADDRESS: 172.19.0.2
=============================================================

>
2019-10-11 22:19:54,036 INFO [org.apereo.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: gsi
WHAT: [status=200-OK,body=ST-1-l6udFD0OXHBYplF91h--lXRnVdY8d63a7ebd424]
ACTION: REST_API_SERVICE_TICKET_CREATED
APPLICATION: CAS
WHEN: Fri Oct 11 22:19:54 UTC 2019
CLIENT IP ADDRESS: 10.85.189.191
SERVER IP ADDRESS: 172.19.0.2
=============================================================


Maksim Kopeyka

unread,
Oct 15, 2019, 8:13:24 AM10/15/19
to CAS Community
Problem has been resolved by adding a header "Accept: text/plain".
Seems to me It should be added to documentation.
Reply all
Reply to author
Forward
0 new messages