如何在Web应用程序中实现用户镜像 [英] How to achieve user mirroring in web application

查看:79
本文介绍了如何在Web应用程序中实现用户镜像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我要求以其他用户身份登录。描述就像是,我们有管理员登录,当我给一个人ID时,我应该能够在新标签中以该用户身份打开应用程序。它应该与实际登录的人类似。



你能否提出一些方法。

解决方案

< blockquote>你所追求的是被称为IIS的用户模仿...



 System.Security.Principal.WindowsImpersonationContext impersonationContext; 
impersonationContext =
((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();

// 在此处插入在身份验证用户的安全上下文中运行的代码。

impersonationContext.Undo();





你会在这里找到一篇非常有用的文章.. 。



https://support.microsoft.com / en-us / kb / 306158 [ ^

Hi,

I have requirement to log in as another user. The description is like, we have admin login and when I give a person id, I should be able to open the application in new tab as that user. It should be similar like the actual person has logged in.

Can you please suggest some approach.

解决方案

What you are after is referred to as user impersonation for IIS...

System.Security.Principal.WindowsImpersonationContext impersonationContext;
impersonationContext = 
    ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();

//Insert your code that runs under the security context of the authenticating user here.

impersonationContext.Undo();



You will find a really useful article here...

https://support.microsoft.com/en-us/kb/306158[^]


这篇关于如何在Web应用程序中实现用户镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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