I am using eclipse to develop 2 parts of an application.
The web part provides REST services and requests to the services are filtered using waffle.servlet.NegotiateSecurityFilter
which extracts the Windows login information to identify the user.
The client part uses HttpURLConnection
to send requests to the web part. As I understand it, the Ntlm information is automatically packed into the request.
While I was testing this in eclipse, it worked fine. When I deployed the client JAR it did not work. I get a 401 Not Authenticated.
After a bit of investigation I found that I can reproduce this in eclipe by setting the execution environment to a JRE instead of the default which is a JDK.
I have JRE "1.8.0_201" and JDK "1.8.0_161" installed.
So, simply by changing the execution environment from JRE to JDK I can get the connection to authenticate.
What does the JDK do differently and what can I do to get the client to work with a JRE?