Apache HTTPClient 4.4.1

I was doing some more tests with proxy authentication and I ran into something 
I didn't expect.  AuthenticationStrategyImpl goes though the list of schemes ( 
SPNEGO, NTLM, ...) to find the ones that have "authentications".  However, this 
goes through all of them and does not stop after it gets one.

I created a CredentialsProvider that prompts the user for a username and 
password for certain schemes.  I was surprised to find out that this made my 
password dialog appeared too often.  I configured my proxy server to allow for 
NTLM and DIGEST authentication schemes.  Then using my HttpClient, I thought 
that if NTLM was higher in priority, and there were credentials for that, it 
would not continue to ask for credentials for the DIGEST scheme.  However, it 
always goes through the whole list.  Is this supposed to be this way?  

Does this make sense with how proxy servers work?  In my case, configuring the 
proxy server to allow NTML and DIGEST authentication means that it will allow 
access if *either* is specified, and does not require both.

It would be nice if AuthenticationStrategyImpl would stop searching once it 
found something, however there does not seem to be an easy way to handle this.  
This makes me think I might be doing something wrong.  I thought a custom 
CredentialProvider would be the correct place to code in a password dialog.  
But maybe there is a better "hook" I can use to bring up the dialog, and then 
just put the information in the CredentialsProvider.  Is there a better place 
to put this code?

It seems the only way to handle this is to re-write AuthenticationStrategyImpl, 
adding a single line so it will stop after the first non-null credentials are 
returned.

Thanks,
Mark 

Disclaimer:
The opinions provided herein do not necessarily state or reflect those of 
Donnell Systems, Inc.(DSI). DSI makes no warranty for and assumes no legal 
liability or responsibility for the posting.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to