hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: CredentialsProvider
Date Tue, 22 Mar 2016 13:40:29 GMT
On Mon, 2016-03-21 at 12:46 +0000, Mark A. Claassen wrote:
> I am testing several different configurations of proxy authentication using the CredentialsProvider.
 It seems that the way this is done is to cache the Credentials, which make sense.  However,
how do I tell if they are incorrect?
> For instance, if I type my user name and password correctly, the caching works perfectly
and I don't get prompted again.  However, if I type them incorrectly, the incorrect credentials
are cached and I don't get opportunity to re-enter the values.  Is there a way to tell that
a credential has been rejected so that I know to not cache it?
> Thanks,
> Mark

Hi Mark,

Valid credentials that are known to have been accepted by the opposite
endpoint(s) are cached by AuthCache [1]

Invalidated credentials get automatically removed from the AuthCache
allowing the CredentialsProvider to provide new creds. 

How exactly credentials are managed by a particular CredentialsProvider
implementation HttpClient makes no assumptions of. As far as
BasicCredentialsProvider is concerned one must manually remove invalid
credentials from its internal map in case of 401 or 407 response from
the opposite endpoint. 



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

View raw message