【发布时间】:2010-11-04 20:09:28
【问题描述】:
我正在努力让 WCF 服务在我们服务器上的 IIS 上运行。部署后,我最终收到一条错误消息:
此服务的安全设置需要“匿名”身份验证,但托管此服务的 IIS 应用程序未启用它。
我想使用 Windows 身份验证,因此我禁用了匿名访问。另请注意,还有 aspNetCompatibilityEnabled(如果这有什么不同的话)。
这是我的 web.config:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<bindings>
<webHttpBinding>
<binding name="default">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="Windows"/>
</security>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="AspNetAjaxBehavior">
<enableWebScript />
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="defaultServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceAuthorization principalPermissionMode="UseWindowsGroups" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="xxx.Web.Services.RequestService" behaviorConfiguration="defaultServiceBehavior">
<endpoint behaviorConfiguration="AspNetAjaxBehavior" binding="webHttpBinding"
contract="xxx.Web.Services.IRequestService" bindingConfiguration="default">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" name="mex" contract="IMetadataExchange"></endpoint>
</service>
</services>
</system.serviceModel>
我在整个互联网上搜索都没有运气。非常感谢任何线索。
【问题讨论】:
-
这个问题应该确定它使用的是哪个版本的 IIS。
标签: wcf security authorization