title: Can't authenticate with different NTLM credentials in one session with java.net.URLConnection
body: <p>When I access a HTTP server using the standard Java API (java.net.URLConnection), the credentials are "cached" after the first successful authentication, and subsequent calls to Authenticator.setDefault() have no effect. So, I need to restart the application in order to use different credentials.</p>
  
  <p>I don't observe this effect when Basic Authentication is used. But I need to use NTLM for the server I'm accessing, and the Jakarta Commons HttpClient isn't an alternative either because it doesn't support NTLMv2 (see <a href="http://oaklandsoftware.com/papers/ntlm.html" rel="nofollow noreferrer">http://oaklandsoftware.com/papers/ntlm.html</a>)</p>
  
  <p>Looking at the packets using Wireshark, I also observe that before the first successful authentication, an authentication with the current Windows credentials is attempted first. But after succesful authentication, only the saved credentials are used.</p>
  
  <p>Is there any way to reset or change the credentials java.net.Authenticator is using after a successful NTLM authentication?</p>