Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 85441 invoked from network); 9 Dec 2008 15:48:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Dec 2008 15:48:10 -0000 Received: (qmail 25722 invoked by uid 500); 9 Dec 2008 15:48:22 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 25702 invoked by uid 500); 9 Dec 2008 15:48:22 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 25690 invoked by uid 99); 9 Dec 2008 15:48:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Dec 2008 07:48:21 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Dec 2008 15:46:51 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LA4oF-0002rI-Km for httpclient-users@hc.apache.org; Tue, 09 Dec 2008 07:47:39 -0800 Message-ID: <20917262.post@talk.nabble.com> Date: Tue, 9 Dec 2008 07:47:39 -0800 (PST) From: Olli Murto To: httpclient-users@hc.apache.org Subject: Re: HttpClient and Siteminder In-Reply-To: <11B0BE2E0E37F645A9E29ED5303ED9A4477B03CB6E@NASANEXMB08.na.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: olli.murto@atrsoft.com References: <11B0BE2E0E37F645A9E29ED5303ED9A4477B03CB6E@NASANEXMB08.na.qualcomm.com> X-Virus-Checked: Checked by ClamAV on apache.org 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