On Wed, 2006-03-01 at 12:27 +0100, Olaf Sebelin wrote:
> Hi,
> 
> Oleg Kalnichevski <[EMAIL PROTECTED]> schrieb am 28.02.2006 um 23:26:
> 
> > On Tue, 2006-02-28 at 16:52 +0100, Olaf Sebelin wrote:
> > > Hello,
> > > 
> > > 
> > > I am using HttpClient 3.0. When I try to establish a HTTPS
> > > connection through a proxy with Basic authentication, the
> > > connection fails, if the credentials are not known and applied
> > > _before_ the first try.
> > > 
> > > What I try to do, is the following: I try to connect to the given
> > > URL. If the proxy returns 407, I request proxy credentials from the
> > > user, set them and retry, like in the following example code:
> 
> [...]
> 
> > 
> > Olaf,
> > 
> > Please post a _complete_ wire/context log of the HTTP session. I'll
> > take a look at it
> > 
> > >  or me using HttpClient the
> > > wrong way?
> > > 
> > 
> > You should rather implement a custom credentials provider if you want
> > the user to be able to authenticate interactively
> > 
> > http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/httpclient/trunk/src/examples/InteractiveAuthenticationExample.java?view=markup
> 
> 
> That did the trick, thank you. Since it gives me the auth-scheme to
> enable preemptive authentication in case of Basic scheme, I do not have
> to do the described "stunt".
> 
> But with this callback for the credentials it is hard to determine, if
> the user just aborted the dialog (abort operation) or entered the wrong
> credentials (reprompt), since HttpMethodDirector just logs the
> CredentialsNotAvailableException away. May be the Exception should be
> thrown to the caller of executeMethod?
> 

Olaf,

If the user simply aborts the dialog, the credentials provider is
supposed to return null instead of throwing an exception. 

Moreover, HttpClient makes no provisions to check whether the same
credentials have been tried already. It is a responsibility of the
custom credentials provider to keep track of authentication attempts and
to ensure that credentials known to be invalid are not retried.


> --- Wire Log follows (with hostnames anonymized) ---
> 

This is clearly a bug in HttpClient. Please file a bug report in
Bugzilla

Oleg


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

Reply via email to