【发布时间】:2011-02-01 15:08:27
【问题描述】:
我希望有人可以帮助我。我有一个通过网络配置设置为安全的网络服务:
<authentication mode="Windows" />
<authorization>
<allow roles="MET\Web-Admin"/>
<deny users="*"/>
<allow users="MET\JoeUser;MET\JoeSmith"/>
</authorization>
在 IIS 7 (Windows Server 2008) 中,它具有以下身份验证集:
Anonymous Authentication:Disabled
ASP.NET Impersonation: Disabled
Basic Authentication Disabled
Forms Authentication: Disabled
Windows Authentication: Enabled
我在 IIS7 中调用它的匿名站点是:
Anonymous Authentication:Enabled
ASP.NET Impersonation: Disabled
Basic Authentication Disabled
Forms Authentication: Enabled
Windows Authentication: Disabled
在匿名网站中,我通过以下方式调用安全网络服务:
moms.momService myMom = new moms.momService();
NetworkCredential netCred = new NetworkCredential(@"username", "password");
strStatus = myMom.createBackupDirectoryAndPrivs(sData);
每次我运行它时,它都会返回未经授权。我已确保此用户在 Web-Admin AD 组中。我还尝试将用户添加为允许用户,但仍然未经授权。我很确定问题出在 IIS 的某个地方,但不确定还有什么要检查的。
顺便说一句:不管怎样,如果我在我的开发盒上通过 VS2010 开发运行匿名站点,并使用上面的代码调用安全站点,它就可以正常工作。这就是为什么我在 PROD 服务器上考虑 IIS。
非常感谢任何帮助。提前致谢。
地理...
【问题讨论】:
标签: asp.net asp.net-mvc