asp.net web.config模拟与应用程序池标识 [英] asp.net web.config impersonation vs application pool identity

查看:116
本文介绍了asp.net web.config模拟与应用程序池标识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在web.config中模拟了一个用户,但该应用程序在使用另一个身份的应用程序池下运行,那么当您访问服务器上的资源(例如文件)时,将使用哪个身份?

If I impersonate a user in the web.config but the application runs under an application pool which uses another identity, which identity would be used when you access resources (say files) on the server?

另一个问题,您能否以与应用程序其余部分不同的身份来运行页面?

Another question, can you run a page under a separate identity from rest of the application?

推荐答案

访问服务器上的资源时,用户将是模拟配置中指定的用户,而不是应用程序池中的用户

When you access resources on the server the user will be the one specified on the impersonation configuration NOT the one on the application pool

已启用对特定身份的模拟.在这种情况下,ASP.NET模拟使用Web.config文件中指定的身份生成的令牌.

<identity impersonate="true"
      userName="domain\user" 
      password="password" />

启用了模拟.在这种情况下,ASP.NET会模拟IIS传递给它的令牌,该IIS是经过身份验证的用户或匿名Internet用户帐户.

 <identity impersonate="true" />

来源: MSDN

如果您有兴趣,请在此处带有用于不同模拟场景的身份矩阵.

In case you're interested, here you have an article with a Identity matrix for different impersonate scenarios.

是的,您可以像Alex Dn所说的那样以编程方式进行模拟

And yes, you can impersonate programatically as Alex Dn said

这篇关于asp.net web.config模拟与应用程序池标识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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