不同的方式与在ASPNET应用模拟得到的WindowsIdentity [英] Different ways to get WindowsIdentity with impersonation in aspnet app

查看:169
本文介绍了不同的方式与在ASPNET应用模拟得到的WindowsIdentity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用程序是使用模拟和Windows身份验证运行。
什么,我在三种情况已经得到了有什么区别?

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
    为的WindowsIdentity

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

WindowsIdentity.GetCurrent()

WindowsIdentity.GetCurrent()

((HttpContext的)上下文).User.Identity
为的WindowsIdentity

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

推荐答案

这里你有所有不同posibilites。在你的情况,你会得到相同的所有3(域\\用户名)

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

这篇关于不同的方式与在ASPNET应用模拟得到的WindowsIdentity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆