Hi,

i confirm that adding the header 'Accept: text/plain'

works perfectly :)

Thank you
Michele

On Tuesday, January 29, 2019 at 3:08:14 PM UTC+1, Dmitriy Kopylenko wrote:
>
> 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]> <javascript:>
> Reply: [email protected] <javascript:> <[email protected]> <javascript:>
> Date: January 28, 2019 at 8:51:25 AM
> To: CAS Community <[email protected]> <javascript:>
> 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 :
>
> [image: Screenshot from 2019-01-28 14-41-40.png]
>
>
>
> 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] <javascript:>.
> 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
>  
> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/2e774cc6-7cab-454a-9f13-850654bed7d7%40apereo.org?utm_medium=email&utm_source=footer>
> .
>
>

-- 
- 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/f33911bd-85ae-4e27-98a2-03562f4a2cd5%40apereo.org.

Reply via email to