Different ways to get WindowsIdentity with imperso

2019-07-24 21:56发布

The app is running using impersonation and windows authentication. What is the difference of what i've got in the three cases?

  • System.Threading.Thread.CurrentPrincipal.Identity as WindowsIdentity

  • WindowsIdentity.GetCurrent()

  • ((HttpContext) context).User.Identity as WindowsIdentity

1条回答
爷、活的狠高调
2楼-- · 2019-07-24 22:44

Here you have all the different posibilites. In your case you'll get the same for all 3 (Domain\UserName)

查看更多
登录 后发表回答