[英]application pool identity change
I've got a web method set up on SERVER A and need to connect to the file system on SERVER B. 我在SERVER A上设置了一个Web方法,需要连接到SERVER B上的文件系统。
Currently I have a wide array of web services that already run on SERVER A where the identity on the application pool is set to NETWORK SERVICE. 当前,我已经在SERVER A上运行了各种各样的Web服务,其中应用程序池上的标识设置为NETWORK SERVICE。 The issue is that I cannot seem to give the NETWORK SERVICE on A access to the file system on B. Changing the user on the app pool isn't really an option as there are too many possible train wrecks that could materialize on the outgoing web service calls. 问题是我似乎无法授予A上的NETWORK SERVICE访问B上的文件系统的权限。在应用程序池上更改用户实际上不是一个选择,因为可能有太多的火车残骸可能在即将离任的网络上实现服务电话。
So the solution I am trying to come up with is temporarily changing the Web Method identity user from NETWORK SERVICE to DOMAIN/SOMEUSER when the web method is called. 因此,我要提出的解决方案是在调用Web方法时将Web方法标识用户从NETWORK SERVICE暂时更改为DOMAIN / SOMEUSER。
The property I need to change is System.Web.HttpContext.Current.User.Identity.Name 我需要更改的属性是System.Web.HttpContext.Current.User.Identity.Name
Can anyone tell me how I can go about doing this? 谁能告诉我该怎么做? Many of the solutions online seem to refer to Windows Azure - which I'm not using, so the approaches outlined don't work. 在线上的许多解决方案似乎都指向Windows Azure-我没有使用它,因此概述的方法不起作用。
Thanks! 谢谢!
You might have to play with the tag in the web.config. 您可能必须使用web.config中的标签。 Our is normally set to <identity impersonate="false" />
and the application pool uses a domain user for permissions. 我们的通常设置为<identity impersonate="false" />
,并且应用程序池使用域用户获得权限。
Try using impersonate in your service. 尝试在服务中使用模拟。
<system.web> ....
<identity impersonate="true" userName="accountname" password="password" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.