title: How to pass windows credentials from an Angular client to a WebAPI?
body: <p>My backend is an ASPNet WebApi2 running under IIS and uses <code>Windows Authentification</code>. </p>
  
  <p>I have 2 clients:</p>
  
  <ol>
  <li><p>WinForms: 
  Passing the credentials is simple. I do the following:</p>
  
  <pre><code>    var credentialCache = new CredentialCache();
      credentialCache.Add(new Uri(uri.GetLeftPart(UriPartial.Authority)), "NTLM", credentials);
  
      WebRequestHandler handler = new WebRequestHandler()
      {
          AuthenticationLevel = AuthenticationLevel.MutualAuthRequested,
          Credentials = credentialCache,
          PreAuthenticate = true,
          UseDefaultCredentials = false
      };
  
      client = new HttpClient(handler, true)
      {
          BaseAddress = uri,
      };
  </code></pre></li>
  <li><p>Angular:
  As the end-user will access the WebApi backend using the Angular app from non-Windows systems, how can I pass his/her windows credentials? (I have a login screen where the user must enter his domain/name and password). </p></li>
  </ol>
  
  <p>I would like to pass the user credentials through code. Something like <a href="https://github.com/Microsoft/typed-rest-client" rel="noreferrer">typed_rest-client</a>. Unfortunately this lib is causing build errors and cannot be used.</p>