title: Authentication for NAV Web Services with Windows User over HTTP Basic Authentication
body: <p>I have a NAV instance which exposes (OData) Web Services and <a href="https://docs.microsoft.com/en-us/dynamics-nav/users-and-credential-types" rel="nofollow noreferrer">is configured to use <code>Windows</code> as the credential type</a>.  I am able to authenticate against these Web Services successfully with <a href="https://en.wikipedia.org/wiki/NT_LAN_Manager" rel="nofollow noreferrer">NTLM</a>.  However, I would prefer to use HTTP basic authentication to authenticate against the service.  I understand that <a href="https://docs.microsoft.com/en-us/dynamics-nav/how-to--use-an-access-key-for-soap-and-odata-web-service-authentication" rel="nofollow noreferrer">one can create an Access Key for authentication</a>.  I understand that if I set the Basic Authentication Username to the <code>User Name</code> and the password to the <code>Web Service Access Key</code> from the NAV User Card, I should be able to use Basic HTTP Authentication.  I have done this successfully on other NAV instances that are configured to use the <code>NavUserPassword</code> credential type.  However, this doesn't work for the instance with <code>Windows</code> credential type.</p>
  
  <p>More specifically, if I request a protected resource from the <code>NavUserPassword</code> instance, I recieve a 401 with a <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate" rel="nofollow noreferrer"><code>WWW-Authenticate</code></a> header with value <code>Basic realm=""</code>.  If I do the same with the <code>Windows</code> instance, I get a <code>WWW-Authenticate</code> header with value <code>NTLM</code>.  This suggests that it's not a simple case of providing the wrong password but a more complicated case of the NAV instance not being configured to accept any Web Service Access Keys.</p>
  
  <p><a href="https://docs.microsoft.com/en-us/dynamics-nav/web-services-authentication" rel="nofollow noreferrer">The documentation on <code>Web Services Authentication</code></a> seems to imply that for Windows credential type, HTTP Basic Authentication for Web Services is not possible, but that isn't very explicit and I'm not sure if I am parsing the documentation correctly.</p>
  
  <p>As an aside, the above documentation suggests that OAuth may also be used as an authentication mechanism but the linked documentation is behind a PartnerSource portal wall.  If HTTP Basic Authentication isn't an option in my case, is OAuth an option?</p>