title: Request.LogonUserIdentity and WindowsIdentity.GetCurrent()
body: <pre><code> Response.Write("Request.LogonUserIdentity.Name:" +Request.LogonUserIdentity.Name);
   Response.Write("&lt;br/&gt;");            
   Response.Write("WindowsIdentity.GetCurrent().Name:" + WindowsIdentity.GetCurrent().Name);
   Response.Write("&lt;br/&gt;");
  </code></pre>
  
  <p>as above, if I use anonymous credential, it will be:</p>
  
  <p><code>Request.LogonUserIdentity.Name</code><strong>:NT AUTHORITY\IUSR</strong></p>
  
  <p><code>WindowsIdentity.GetCurrent().Name</code><strong>:IIS APPPOOL\TestSite</strong></p>
  
  <p>But after impersonator, <code>LoginUserIdentity</code> will be the same</p>
  
  <p><code>Request.LogonUserIdentity.Name</code><strong>:NT AUTHORITY\IUSR</strong></p>
  
  <p><code>WindowsIdentity.GetCurrent().Name</code><strong>:impersonator identity</strong></p>
  
  <p><strong>MSDN</strong> said that</p>
  
  <blockquote>
    <p>The LogonUserIdentity property exposes the properties and methods of
    the WindowsIdentity object for the currently connected user to
    Microsoft Internet Information Services (IIS).</p>
  </blockquote>
  
  <p>Why <code>loginUserIdentity</code> is always the identity anonymous used??</p>