You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Olli Murto <ol...@atrsoft.com> on 2008/12/09 16:47:39 UTC
Re: HttpClient and Siteminder
Hello Robert,
I had the same problem with HttpClient and SiteMinder, received the same
Exception at the exact same phase.
I noticed I was using commons-httpclient-3.1.jar. I fixed this error by
changing back to the 3.0.1 version of the jar.
Can't explain why this threw the exception with the newer .jar while parsing
the redirect URL - I'm no Java Programming guru ;-)
Cheers,
Olli
Stone, Robert-2 wrote:
>
> Hi,
>
> I'm trying to get access code for URL that is protected by Siteminder
> (SM). Elsewhere in the code I'm getting SM cookie for the current user.
> Now I'm trying to reuse this cookie to access URL and get the access code.
> The problem is that instead of following redirect and getting actual URL I
> am getting InvalidRedirectLocationException for the redirect URL of SM
> agent.
>
> Here's cookie I'm adding (truncated)
> JSESSIONID=9775B7EA48F0FEE86221B80B88FB214C; SMCHALLENGE=YES;
> SMIDENTITY=OQGA6QPST1Ho82Qr...
>
> Here's the code
>
> String allCookies = getCurrentCookies();
>
> HttpClient client = new HttpClient();
>
> client.getHttpConnectionManager().getParams()
>
> .setBooleanParameter(
>
> "http.connection.stalecheck", true);
>
>
> HttpMethod get = new GetMethod(location);
>
> get.setFollowRedirects(true);
>
> get.getParams().setCookiePolicy(
>
> CookiePolicy.BROWSER_COMPATIBILITY);
>
> get.setRequestHeader("Cookie", allCookies);
>
> int rCode = client.executeMethod(get);
>
> And here's the exception:
> org.apache.commons.httpclient.InvalidRedirectLocationException: Invalid
> redirect location:
> https://logintest.foocomm.com/siteminderagent/nocert/1224689077/smgetcred.scc?TYPE=16777217&REALM=$SM$FoonetApps%20Dev%2fTest%20[08%3a24%3a37%3a8525]&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=$SM$VIKCnIwFQBmaHrauIuaDE0Vxdt37jIIv5x3U5CdHFaRgnjYIvMJC2kStw8Ioq%2byh&TARGET=$SM$http%3a%2f%2ffoonetapps-test%2efoocomm%2ecom%2fLegalContracts%2fpages%2fcontractsHome%2exhtml
>
> Looks like HttpClient doesn't like Siteminder URL but I am not clear why
> does client try to process it? Shouldn't it be processed and redirected
> by the SM agent and not passed to HC at all? What am I missing?
>
> Regards,
>
> Bob Stone
>
>
>
--
View this message in context: http://www.nabble.com/HttpClient-and-Siteminder-tp20113436p20917262.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org