Hi,

there was one custom HttpMessageConverter added in 6.0 which messes up with the 
body of a response on the way back during content negotiation (if by default 
Accept header value is set to */*): 
https://github.com/apereo/cas/blob/master/core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/util/RegisteredServiceYamlHttpMessageConverter.java

Set the Accept header value to text/plain and you should be good to go.

I don’t know yet if it’s a “bug” or “feature”.

Cheers,
D.

From: Michele Melluso <[email protected]>
Reply: [email protected] <[email protected]>
Date: January 28, 2019 at 8:51:25 AM
To: CAS Community <[email protected]>
Subject:  [cas-user] [6.x] [REST Protocol] [Request a Service Ticket] HTTP 200 
- empty body  

Hi all,

we're trying to integrate Rest Protocol as described here:

https://apereo.github.io/cas/6.0.x/protocol/REST-Protocol.html

in 5.3.6 everything works just fine, we obtain TGTs and STs also in Jwt format.

in all 6.x versions we manage to get a TGT (also in JWT format) but when we try 
to get an ST we receive a 200 response with empty body.
Our java version is java-11-openjdk-11.0.1.13-10.fc29.x86_64

the Api is called exactly as in 5.3.6 version:

curl -X POST \
  https://localhost:8443/cas/v1/tickets/TGT-1-sF-................... \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'cache-control: no-cache' \
  -d 'service=https%3A%2F%2Flocalhost......&ticket=true'

the result is:
HTTP/1.1 200 
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=15768000 ; includeSubDomains
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: Mon, 28 Jan 2019 13:48:52 GMT
Server: Apereo CAS




Cas log says that the ticket is created:
=============================================================
WHO: {myuser}
WHAT: [status=200-OK,body=ST-1-GiBOLycp8wL.........]
ACTION: REST_API_SERVICE_TICKET_CREATED
APPLICATION: CAS
WHEN: Mon Jan 28 14:34:39 CET 2019
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================


Debugging the following class i can see a nicely populated ResponseEntity :





org.apereo.cas.support.rest.resources.ServiceTicketResource.createServiceTicket

return this.serviceTicketResourceEntityResponseFactory.build(tgtId, service, 
authenticationResult);

but no body is returned.


any help is welcome
thanks in advance
Michele
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/2e774cc6-7cab-454a-9f13-850654bed7d7%40apereo.org.

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/etPan.5c505e48.70a80431.1390%40unicon.net.

Reply via email to