Thanks. I will try to list the steps in our case. The following steps work fine 
for GET since it does not contain any “body”;


1.        In our case, we are making a call to the CAS server to get a ST as 
the first step.

2.        Attach the ST to the URL of the actual POST service. So essentially 
avoids the redirect 302 step.

3.       Call the POST.

4.        the SAM module of JASPIC validates the ST with CAS server.

5.        The validation is successful. However, when the SAM module now tries 
to call the actual service, the POST data is lost.

6.       The call fails.



The trick is to save and restore the POST payload. I am not a JASPIC expert. I 
am thinking it could probably help to have a session and associate the POST 
data with that session before the validation call.  Post validation, 
re-associate the post data with the actual request.



Hope I am making sense here. Any input is appreciated.



Regards

Prasad

From: Carl Waldbieser [mailto:cwaldbie...@gmail.com]
Sent: Saturday, August 22, 2015 4:13 AM
To: cas-user@lists.jasig.org
Subject: RE:[cas-user] problem with POST requests


In that email thread, the issue is that the browser initially has no session 
with the proxy protecting the resouce.  When the proxy redirects the user to 
the CAS service using a GET, the initial POST data is lost.

If this is analogous to what is happening in the original poster's case, the 
way to get around it is to make 2 requests.  The first to a GETable resource.  
This establishes an authenticated session with the service by doing the CAS 
dance.  The second request would need to use the session cookie from the first 
request when it made the POST and CAS would get out of the way.

Strictly speaking, that is not a RESTful API.  It would make more sense for a 
RESTful API to hand out an access token in response to a GET for a valid CAS 
service ticket.  The access token could then be used to authenticate to the 
rest of the API without having to monkey around with cookies and sessions.

Thanks,
Carl Waldbieser
On Aug 21, 2015 6:03 PM, "Andrew Morgan" 
<mor...@orst.edu<mailto:mor...@orst.edu>> wrote:
Have a look at this email thread:

  https://groups.google.com/forum/#!topic/jasig-cas-user/if0SQ0gUbp8

It's an old problem.

I'm not sure how CAS JASPIC works, but I've seen the Java cas client in action. 
 It seems to consume the ST, validate the ST, then redirect the client to the 
original resource.  Like this:

GET /foo?ST=12345
(processing happens to validate the ST)
RESPONSE: 302 REDIRECT /foo
GET /foo


When the redirect happens, the POST data is lost.

It might work if you switched from POST to GET.

You can read about some options and recommendations in the email thread above.

        Andy

On Fri, 21 Aug 2015, Mahantesh Prasad Katti wrote:

Has anybody run into this problem? Do you think i need to explain this problem 
better or provide additional info?

Regards
Prasad

From: Mahantesh Prasad Katti
Sent: Friday, August 21, 2015 2:39 PM
To: cas-user@lists.jasig.org<mailto:cas-user@lists.jasig.org>
Subject: [cas-user] problem with POST requests

Hi ,

We have a casified java application. This application exposes a bunch of REST 
apis. When accessing POST APIs from another application by explicitly obtaining 
the service ticket and appending it to the target URL, the calls are failing. 
Apparently, the after the ticket validation happens successfully, the POST body 
data gets lost and the service call fails because of that. Do we need to modify 
the server auth module to handle this scenario? Note that this happens for POST 
calls only. The get calls work just fine.

We are using the CAS JASPIC jar available from google groups. Any help is 
appreciated.

Regards
Prasad





--

You are currently subscribed to 
cas-user@lists.jasig.org<mailto:cas-user@lists.jasig.org> as: 
mahantesh.ka...@indecomm.net<mailto:mahantesh.ka...@indecomm.net>

To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

--
You are currently subscribed to 
cas-user@lists.jasig.org<mailto:cas-user@lists.jasig.org> as: 
mor...@orst.edu<mailto:mor...@orst.edu>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

--
You are currently subscribed to 
cas-user@lists.jasig.org<mailto:cas-user@lists.jasig.org> as: 
cwaldbie...@gmail.com<mailto:cwaldbie...@gmail.com>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user



--

You are currently subscribed to cas-user@lists.jasig.org as: 
mahantesh.ka...@indecomm.net

To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to cas-user@lists.jasig.org as: 
arch...@mail-archive.com
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to