Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 60575 invoked from network); 28 Jul 2005 14:02:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Jul 2005 14:02:45 -0000 Received: (qmail 64682 invoked by uid 500); 28 Jul 2005 14:02:27 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 64576 invoked by uid 500); 28 Jul 2005 14:02:26 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 64435 invoked by uid 99); 28 Jul 2005 14:02:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jul 2005 07:02:25 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of nicolas.deloof@capgemini.com designates 194.3.247.82 as permitted sender) Received: from [194.3.247.82] (HELO mxepar01.capgemini.com) (194.3.247.82) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jul 2005 07:02:16 -0700 Received: from mxipar01.capgemini.com (prvmta2 [194.3.224.82]) by mxepar01.capgemini.com (8.13.3/8.13.3) with ESMTP id j6SE2KYg000016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 28 Jul 2005 16:02:20 +0200 (MEST) Received: from prvmta2.capgemini.com (localhost [127.0.0.1]) by mxipar01.capgemini.com (8.13.3/8.13.3) with ESMTP id j6SE2KEH026018 for ; Thu, 28 Jul 2005 16:02:20 +0200 (MEST) Received: from pasteur2.capgemini.fr (smtp.capgemini.fr [10.67.1.90]) by prvmta2.capgemini.com (8.13.3/8.13.3) with ESMTP id j6SE2Jhf026013 for ; Thu, 28 Jul 2005 16:02:19 +0200 (MEST) Received: from pasteur.capgemini.fr (localhost [127.0.0.1]) by pasteur2.capgemini.fr (8.12.10/8.12.10) with ESMTP id j6SE2Ir3014135 for ; Thu, 28 Jul 2005 16:02:18 +0200 (MEST) Received: from [127.0.0.1] ([10.67.188.79]) by pasteur.capgemini.fr (8.12.10/8.12.10) with ESMTP id j6SE2Eso013961 for ; Thu, 28 Jul 2005 16:02:17 +0200 (MEST) Message-ID: <42E8E566.4000002@capgemini.fr> Date: Thu, 28 Jul 2005 16:02:14 +0200 From: Nicolas De Loof User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: fr, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [httpclient] How to force use of Authentication header ? References: <42E8D53F.6050606@capgemini.fr> <20050728130009.GA30682@uml24.umlhosting.ch> In-Reply-To: <20050728130009.GA30682@uml24.umlhosting.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 0521-2, 25/05/2005), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I'm using Basic authentication. The problem is I'm using Axis "CommonsHttpSender" and not directly commons-http. The only way I've found to make it work is to extends CommonsHttpSender and override "getHostConfiguration" protected method to put a hack : protected HostConfiguration getHostConfiguration(HttpClient client, MessageContext context, URL targetURL) { client.getParams().setAuthenticationPreemptive(true); return super.getHostConfiguration(client, context, targetURL); } I was looking for a way to setup 'global' parameters to set this as defualt. I've tested setting HttpClientParams.PREEMPTIVE_AUTHENTICATION as a param in HttpConnectionManager, but this has no effect. Nico. Oleg Kalnichevski a �crit : >Nicolas, > >Please refer to the section on preemptive authentication in the >HttpClient authentication guide: > >http://jakarta.apache.org/commons/httpclient/authentication.html#Preemptive%20Authentication > >Please note that only BASIC authentication can be (should be) used >preemptively. If you your application requires a more secure >authentication scheme, consider using the so called 'expect-continue' >handshake instead: > >http://jakarta.apache.org/commons/httpclient/performance.html#Expect-continue%20handshake > >Hope this helps, > >Oleg > > >On Thu, Jul 28, 2005 at 02:53:19PM +0200, Nicolas De Loof wrote: > > >>Hello, >> >>I'm building a web service client (Axis based) that uses >>commons-httpclient as transport. >>My web service uses HTTP Basic authentication for security. >> >>In current commons-httpclient (3.0-rc3) no Authentication header is set >>until the server send an "Authentication Required" response. This has >>the side-effect my WS client has to send it's request 2 times to get the >>service to work. >> >>Is they're a way to force httpclient to set Authentication header in >>every request ? >> >>Nico. >> >>This message contains information that may be privileged or confidential >>and is the property of the Capgemini Group. It is intended only for the >>person to whom it is addressed. If you are not the intended recipient, you >>are not authorized to read, print, retain, copy, disseminate, distribute, >>or use this message or any part thereof. If you receive this message in >>error, please notify the sender immediately and delete all copies of this >>message. >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org >>For additional commands, e-mail: commons-user-help@jakarta.apache.org >> >> >> >> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org