title: .net core 1.1 angular 5 windows authentication 401 unauthorized
body: <p>I have a web api with the iis authentication turn on in order to extricate the windows user_name.</p>
  
  <p>In order to develop with my angular app I have to run it on the localhost.
  Each time I try to do a post my webapi I get 401 unauthorized.</p>
  
  <p>What can I do?
  Can I use a proxy?</p>
  
  <p><strong>update</strong></p>
  
  <p>I have come a cross with this bit of code for porxy:</p>
  
  <pre><code>    const Agent = require('agentkeepalive');
  
  module.exports = {
          '/api': {
              target: 'http://localhost:59465',
              secure: false,
              agent: new Agent({
                  maxSockets: 100,
                  keepAlive: true,
                  maxFreeSockets: 10,
                  keepAliveMsecs: 100000,
                  timeout: 6000000,
                  keepAliveTimeout: 90000
              }),
              onProxyRes: proxyRes =&gt; {
                  let key = 'www-authenticate';
                  proxyRes.headers[key] = proxyRes.headers[key] &amp;&amp;
                      proxyRes.headers[key].split(',');
              }
          }
  };
  </code></pre>
  
  <p>This proxy all ready create an authenticate call so I did not needed to authenticate my calls to the web api.</p>
  
  <p>I found it here:
  <a href="https://www.meekdeveloper.com/angular-cli-asp-net-core-windows-authentication/" rel="nofollow noreferrer">https://www.meekdeveloper.com/angular-cli-asp-net-core-windows-authentication/</a></p>