title: Why do Thread.CurrentPrincipal.Identity and WindowsIdentity.GetCurrent() differ when impersonation is turned on?
body: <p>I enabled impersonation and Windows authentication.</p>
  <pre><code>&lt;authentication mode=&quot;Windows&quot; /&gt;
  &lt;identity impersonate=&quot;true&quot; userName=&quot;name&quot; password=&quot;passord&quot;/&gt;
  </code></pre>
  <p>But <code>Thread.CurrentPrincipal.Identity.Name</code> returns the name of authenticated user and <code>WindowsIdentity.GetCurrent()</code> returns impersonated identity.</p>
  <p>Shouldn't these identities be the same?</p>
  <p>And under which credentials does the code run in this case?</p>