简体   繁体   English

ASP.NET Web服务权限使用机器帐户读取文件系统

[英]ASP.NET web service permissions reading file system using machine account

I have a web application that runs on SERVER_A. 我有一个在SERVER_A上运行的Web应用程序。 The web application calls a web service which runs on SERVER_B. 该Web应用程序调用在SERVER_B上运行的Web服务。 The web service returns a set of folder names on the file system from SERVER_B. Web服务从SERVER_B返回文件系统上的一组文件夹名称。 However the web service fails to return any content when I run my application from SERVER_A, but it works OK when I access the web service directly via a browser or my localhost ie via Visual Studio. 但是,当我从SERVER_A运行应用程序时,Web服务无法返回任何内容,但是当我直接通过浏览器或本地主机(即通过Visual Studio)访问Web服务时,Web服务可以正常工作。 I can get it to work for SERVER_A if I grant the machine name (SERVER_A) access to the file system via Properties > Security. 如果我通过“属性”>“安全性”授予计算机名(SERVER_A)访问文件系统的权限,则可以使其对SERVER_A起作用。 But I don't think this is very secure..? 但是我认为这不是很安全。

Ideally I need to grant a service account the correct permissions, but how do I do this? 理想情况下,我需要授予服务帐户正确的权限,但是我该怎么做? Do I need to run my application on SERVER_A as this service account in order for it pass the identity when it connects to my web service? 我是否需要在SERVER_A上以该服务帐户身份运行我的应用程序,以便它在连接到Web服务时传递身份? If so how do I do this? 如果是这样,我该怎么做?

You can specify the credientials you are using with the webservice. 您可以指定与Web服务一起使用的凭证。 Once you create your service account (if you haven't already) you can specify the credentials when trying to consume the webservice...here is a MS kb article (take a look at the "Second Method"). 一旦创建了服务帐户(如果尚未创建),则可以在尝试使用Web服务时指定凭据。这是一篇MS kb文章(请查看“第二种方法”)。

http://support.microsoft.com/kb/811318 http://support.microsoft.com/kb/811318

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM