Why is pre-authentication required?
System.setProperty ("httpclient.authentication.preemptive", "true");
I wrote a client services program to access web services in Java. Where we set the username and password in the call object, and it worked fine.
Recently, our service provider made some changes on their side, after which they did not receive the username and password in the call to the web service, and because they did not receive the username and password, so we could not connect to their service (provider).
Then I did a googling search and discovered proactive authentication. When invoking web services, we set "httpclient.authentication.preemptive" to "true" - System.setProperty ("httpclient.authentication.preemptive", "true"); then we can receive answers from our service provider.
When we remove System.setProperty ("httpclient.authentication.preemptive", "true"); line, then we cannot connect to their services.
source share