Michele/Dmitriy,

I have found  how to pass to my header 'Accept: text/plain' while using 
POST method but after getting the jwt token not able to retrieve Payload 
data due to that our authentication is failing  

Did you faced this issue?, if not can you please let me know what should be 
added to my end to get it work properly 

On Tuesday, January 28, 2020 at 12:41:41 AM UTC+5:30, Raheem Shaik wrote:
>
> Hi Michele,
>
> I am also facing the same issue on cas 6.0.x , can you please let me know 
> where i have to add the header 'Accept: text/plain'
>
> Regards,
> Raheem
>
> On Tuesday, January 29, 2019 at 8:01:25 PM UTC+5:30, Michele Melluso wrote:
>>
>> 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]>
>>> 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 :
>>>
>>> [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].
>>> 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>
>>> .
>>>
>>>
-- 


********************************************



 

*Inmar Confidentiality 
Note*:  This e-mail and any attachments are confidential and intended to be 
viewed and used solely by the intended recipient.  If you are not the 
intended recipient, be aware that any disclosure, dissemination, 
distribution, copying or use of this e-mail or any attachment is 
prohibited.  If you received this e-mail in error, please notify us 
immediately by returning it to the sender and delete this copy and all 
attachments from your system and destroy any printed copies.  Thank you for 
your cooperation.



 

*Notice of Protected Rights*:  The removal of any 
copyright, trademark, or proprietary legend contained in this e-mail or any 
attachment is prohibited without the express, written permission of Inmar, 
Inc.  Furthermore, the intended recipient must maintain all copyright 
notices, trademarks, and proprietary legends within this e-mail and any 
attachments in their original form and location if the e-mail or any 
attachments are reproduced, printed or distributed.

 


********************************************

-- 
- 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/ed1f0c1b-c5a3-4b30-b0a7-cf2cfcee2ff7%40apereo.org.

Reply via email to