title: Asp net Core Get user Windows username
body: <p>Building an intranet in ASP .net CORE mvc, I need to get the Windows username of the current user for the login, I do not need to automaticaly login the user with Windows Authentication, I have already a custom login Controller to do that, I only need his username.<br>
  It work fine on local but I cannot get the username when on the IIS server :<br>
  <strong>Local :</strong> </p>
  
  <pre><code>Environment.UserName =&gt; VeronY 
  System.Security.Principal.WindowsIdentity.GetCurrent().Name =&gt; Domain\VeronY
  </code></pre>
  
  <p><strong>IIS server :</strong></p>
  
  <pre><code>Environment.UserName =&gt; Intranet
  System.Security.Principal.WindowsIdentity.GetCurrent().Name =&gt; APPPOOL\Intranet 
  </code></pre>
  
  <p>With Windows Auhtentication it auto login me which is not what I need.
  There must be 2 type of authentication : Automatic with AD and Manual with form manage by Identity Framework.</p>