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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to