Different ways to get WindowsIdentity with impersonation in aspnet app

那年仲夏 提交于 2019-12-11 07:39:57

问题


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:


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



来源:https://stackoverflow.com/questions/6387589/different-ways-to-get-windowsidentity-with-impersonation-in-aspnet-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!