【发布时间】:2011-10-28 11:57:08
【问题描述】:
我有一个使用 Windows 身份验证的 Web 服务。 Web 服务托管在 IIS 上。是否可以将对该 Web 服务的访问范围缩小到少数特定用户?我当前的网络配置:
<services>
<service name="LANOS.SplunkSearchService.SplunkSearch">
<endpoint binding="basicHttpBinding" bindingConfiguration="basicHttp"
contract="LANOS.SplunkSearchService.ISplunkSearch" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="basicHttp" allowCookies="true" maxBufferSize="20000000"
maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000">
<readerQuotas maxDepth="32" maxStringContentLength="200000000"
maxArrayLength="200000000" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
顺便说一下,我尝试了一个类似的解决方案,这是我在网上找到的:
<authentication mode="Windows"/>
<authorization>
<allow roles=".\Developers"/>
<allow users="DOMAIN\ServiceAccount"/>
<deny users="*"/>
</authorization>
但它不起作用。 :( 它让所有域用户通过。
【问题讨论】:
-
您是否为在 IIS 中托管 WCF 服务的应用程序禁用了匿名身份验证并启用了 Windows 身份验证?
标签: c# wcf web-services