users@jersey.java.net

[Jersey] Re: Redirect from client filter

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Wed, 15 Aug 2012 10:15:24 +0200

Hello Gang,

you can execute completely different request (or modified one) in
filter. All you need to do is call next().handle(Request) with different
one. And additionally - you don't need to return that immediately, you
can execute another request (based on result from previous one for
example). See HTTPDigestAuthFilter for example [1].

Regards,
Pavel

[1]
http://java.net/projects/jersey/sources/svn/content/trunk/jersey/jersey-client/src/main/java/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.java?rev=5760

On 8/14/12 5:59 PM, gang.yang.ctr_at_mail.mil wrote:
> Hi,
>
> I'm trying to enable SAML2-based SSO for REST WS. The current SAML2-SSO
> I have uses POST profile. So I need to be able to redirect the HTML
> POST Form-based response from the IdP back to the SP at Jercey client.
> In other words, I need to be able to simulate a brower to handle the
> HTML POST Form that contains the SAML response and automatically submit
> the Form to its action URL. Since Jercey client can only do the HTTP
> redirect automatically, I'm thinking to use the client filter. But I
> don't see the ClientFilter class provide redirect capabilitt. Is there
> a way to do what I like to do here in Jercey client?
>
> Thanks,
> Gang
>
>