title: How to implement NTLM Authentication for UIWebView?
body: <p>I have a use case where a <code>UIWebView</code> may need to connect with a web server secured with NTLM.  I also have a use case where I already have the credentials to be passed.  So instead of forcing the user to enter them, how do I perform the handshake with the <code>UIWebView</code>?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Using this method <a href="https://stackoverflow.com/questions/1769888/how-to-display-the-authentication-challenge-in-uiwebview">here</a> works well enough when you are doing simple GET requests, but utterly fails when doing POSTs, for the mere fact that it is doing a GET after it is posted.</p>
  
  <p>The ASIHttpRequest and ASIWebPageRequest have the same problem.  GET requests work wonders, but any POSTs just don't work.  If only the world worked on just GET requests.</p>
  
  <p>I have been able to use <a href="https://stackoverflow.com/questions/3349240/uiwebview-does-not-persist-authentication-on-ios3-2-ios4">this method</a> of including the username and password in the HTTP request string, but that is so grossly insecure as to defy reason for using it.  Using a sniffer I am able to see the three-way handshake occur without any problems on both GET and POST requests.</p>