title: NTLM authentication with httpclient 4.2.1
body: <p>I need to do a HTTP GET to a URL that needs NTLM authentication. I can access the URL using Firefox or Chrome on a MacBook Pro. The browser asks for the username/password combo and it works. I am now trying to do the same from Groovy using HttpClient. I followed the <a href="http://hc.apache.org/httpcomponents-client-ga/ntlm.html" rel="nofollow">NTLM support guide</a>, but I always get a <code>401 Unauthorized</code> back. There is also this sentence in the response:</p>
  
  <blockquote>
    <p>You do not have permission to view this directory or page using the
    credentials that you supplied because your Web browser is sending a
    WWW-Authenticate header field that the Web server is not configured to
    accept.</p>
  </blockquote>
  
  <p>I tried all kinds of combinations for the servername and domain (the remote windows pc is not on a domain) in this piece of code, but I always get the same response.</p>
  
  <pre><code>httpclient.getCredentialsProvider().setCredentials(
  new AuthScope("myserver", -1), 
  new NTCredentials("username", "password", "MYSERVER", "MYDOMAIN"));
  </code></pre>
  
  <p>Anybody had the same problem and managed to solve it? Note that this is an external program that uses IIS under the hood, so I don't think I can change any settings there.</p>
  
  <p>EDIT:</p>
  
  <p>Unlike what I have said, I managed to change the security settings in IIS to accept BASIC authentation, so I don't have the problem anymore.</p>