如何在不知道密码的情况下获取另一个用户的 WindowsIdentity?
我试图拦截 WindowsAuthenticationModule 以作为另一个用户登录应用程序,但如果不知道他的密码,我无法创建新的 WindowsIdentity。该代码将在管理员权限下运行,那么,有没有办法在没有密码的情况下获取用户“登录令牌”?
I'm trying to intercept WindowsAuthenticationModule to login into application as another user, but I cannot create new WindowsIdentity without knowing his password. The code will run under administrator privilegies, so, is there any way how to get user 'Login token' without his password?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 Windows Server 2003 及更高版本开始,您可以执行所谓的“协议转换”。
它确实需要管理员权限,并且根本不建议您使用管理员权限运行网站,因此如果您绝对必须这样做,您应该考虑这一点将功能块转移到以更高权限模式运行的单独进程中。 Keith Brown 提供了有关该主题的更多信息。
你应该需要这个功能,所以除非你绝对确定你在做什么,否则我建议你写另一个SO问题来概述你的一般挑战是什么,看看是否有人可以提出一些更好的选择。
From Windows Server 2003 and forward, you have the ability to perform what is called Protocol Transition.
It does require Administrator privileges, and it is not at all recommended that you run a web site with admin privileges, so if you absolutely must do this, you should factor this particular piece of functionality out into a separate process that runs in higher privilege mode. Keith Brown has more information on the subject.
It is very rare that you should ever need this functionality, so unless you are absolutely certain about what you are doing, I suggest that you write another SO question that outlines what your general challenge is, and see if someone can suggest some better alternatives.