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: Preemptive authentication examples wrong
Date Tue, 23 Aug 2011 12:43:23 GMT
On Tue, 2011-08-23 at 14:09 +0200, Christian Migowski wrote:
> Hi,
> 
> I need to use preeemptive authentication and was very frustrated to see
> that the simple client.getParams().setAuthenticationPreemptive(true);
> of older versions
> was replaced by a block of not understandable code in the tutorial that
> everyone now needs to implement in his code every time he needs this
> functionality - very wrong way in my opinion.
> 
> 

When using preemptive authentication (especially indiscriminately like
the old versions of HttpClient used to do) one better understand the
security implications of their actions. If you do not understand what
you are doing, do not use preemptive authentication.


> I am writing now because the examples posted under
> http://hc.apache.org/httpcomponents-client-ga/tutorial/html/authenticati
> on.html and
> http://hc.apache.org/httpcomponents-client-ga/httpclient/examples/org/ap
> ache/http/examples/client/ClientPreemptiveBasicAuthentication.java
> 
> are not working with the latest HttpClient 4.1.2 -
> ClientContext.AUTH_CACHE and EntityUtils.consume are not available :(


you are wrong

http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/util/EntityUtils.html#consume%28org.apache.http.HttpEntity%29

http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/protocol/ClientContext.html#AUTH_CACHE

Oleg



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


Mime
View raw message