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. Oleg [1] http://hc.apache.org/httpcomponents-client-4.5.x/httpclient/apidocs/org/apache/http/client/AuthCache.html --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org