You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ronald van den Heuvel <Ro...@enovation.nl> on 2006/06/20 11:51:06 UTC
Commons HTTPClient, BASIC auth
Hi, everyone.
I am using Axis 1.4 as a client and use Jakarta Commons HTTPClient for
HTTPTransport. When I look at the traffic between the server (also Axis)
which uses BASIC authentication I see that there are a lot of 401
errors. The reason for this, is that Commons HTTPClient only sends BASIC
authentication when a Request is responded by a 401 error.
Is there a way to force this so that it will always send the BASIC auth
header?
Thanks
Ronald
Re: Commons HTTPClient, BASIC auth
Posted by Cyrille Le Clerc <cy...@pobox.com>.
A small mistake in the attached file. Here is the fixed version.
By the way, I will propose a patch for AXIS-2506 soon, currently
testing on my box.
Cyrille.
On 6/20/06, Cyrille Le Clerc <cy...@pobox.com> wrote:
> Hello Ronald,
>
> Preemptive authentication is an out-of-the-box feature of Commons
> HttpClient via httpClient.getParams().setAuthenticationPreemptive(true).
>
> Unfortunately, it is not wired in axis' CommonsHTTPSender.
>
> Once more, unfortunately, I did not find an elegant way to subclass
> CommonsHTTPSender to add this behavior. I attached a customized
> version of CommonsHttpSender to add this line of code.
>
> I advise you to create a bug in Jira ; we would then be able to
> propose a clean patch.
>
> Cyrille
>
> --
> Cyrille Le Clerc
> cyrille.leclerc@pobox.com
> cyrille.leclerc@fr.ibm.com
> +33 6.61.33.69.86
>
> On 6/20/06, Ronald van den Heuvel <Ro...@enovation.nl> wrote:
> >
> >
> >
> > Hi, everyone.
> >
> >
> >
> >
> > I am using Axis 1.4 as a client and use Jakarta Commons HTTPClient for HTTPTransport. When I look at the traffic between the server (also Axis) which uses BASIC authentication I see that there are a lot of 401 errors. The reason for this, is that Commons HTTPClient only sends BASIC authentication when a Request is responded by a 401 error.
> >
> >
> >
> > Is there a way to force this so that it will always send the BASIC auth header?
> >
> >
> >
> > Thanks
> >
> > Ronald
>
>
>
--
Cyrille Le Clerc
cyrille.leclerc@pobox.com
cyrille.leclerc@fr.ibm.com
+33 6.61.33.69.86
Re: Commons HTTPClient, BASIC auth
Posted by Cyrille Le Clerc <cy...@pobox.com>.
Hello Ronald,
Preemptive authentication is an out-of-the-box feature of Commons
HttpClient via httpClient.getParams().setAuthenticationPreemptive(true).
Unfortunately, it is not wired in axis' CommonsHTTPSender.
Once more, unfortunately, I did not find an elegant way to subclass
CommonsHTTPSender to add this behavior. I attached a customized
version of CommonsHttpSender to add this line of code.
I advise you to create a bug in Jira ; we would then be able to
propose a clean patch.
Cyrille
--
Cyrille Le Clerc
cyrille.leclerc@pobox.com
cyrille.leclerc@fr.ibm.com
+33 6.61.33.69.86
On 6/20/06, Ronald van den Heuvel <Ro...@enovation.nl> wrote:
>
>
>
> Hi, everyone.
>
>
>
>
> I am using Axis 1.4 as a client and use Jakarta Commons HTTPClient for HTTPTransport. When I look at the traffic between the server (also Axis) which uses BASIC authentication I see that there are a lot of 401 errors. The reason for this, is that Commons HTTPClient only sends BASIC authentication when a Request is responded by a 401 error.
>
>
>
> Is there a way to force this so that it will always send the BASIC auth header?
>
>
>
> Thanks
>
> Ronald