HttpContext.Current.User.Principal vs WindowsIdentity.GetCurrent()
What's the difference in an asp.NET environment with Windows Authentication and Identity Impersonation turned on, between HttpContext.Current.User.Principal and WindowsIdentity.GetCurrent()? According to this forum on WindowsIdentity.GetCurrent().Name vs. User.Identity.Name : User.Identity.Name represents the identity passed from IIS. WindowsIdentity.GetCurrent().Name is the identity under which the thread is running. Depending on your app's authentication settings in IIS, they will return different values: | Anonymous | Impersonate | User.Identity.Name | WindowsIndentiy.GetCurrent() | |------