On Thu, 2023-07-13 at 15:27 +0000, D'Ascola, Giovanni wrote: > Is there a way to implement preemptive basic authentication with > Apache HttpClient 5.2 using a HttpRequestInterceptor similar to how > it's done here (accepted > response)<https://stackoverflow.com/questions/2014700/preemptive-basi > c-authentication-with-apache-httpclient-4> for Apache HttpClient 4? > > > > We use Apache HttpClient both directly and as the RestTemplate > underlying Http client. Preemptive auth used to work with HttpClient > 4 using HttpRequestInterceptor (see the accepted response for the > question I linked above), but we can't reuse the same code as the > AuthScheme class is now gone. > > > > I tried a few of things but neither worked (see below).
Have you looked at: https://hc.apache.org/httpcomponents-client-5.2.x/examples.html https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/test/java/org/apache/hc/client5/http/examples/ClientPreemptiveBasicAuthentication.java ? Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org