【发布时间】:2012-03-16 21:35:21
【问题描述】:
我在这里和任何地方都多次看到这个问题,但我无法理解它。
这就是我想要做的。我需要在 IIS 6 中托管 WCF 服务。我想要用户名/密码安全,我不希望这些未加密传递,所以我使用 HTTPS。我在我的 IIS 上本地工作,但是当我开始部署它时,我得到匿名访问未启用错误。在我的本地 IIS 上启用了匿名访问,在部署的服务器上没有启用它,我们不想启用它。问题明白了。解决方案对我来说并不明显......
如果我导航到 IE 中的页面,或者从 Visual Studio 添加服务引用,我在输入我的用户名/密码后会收到此错误。所以这表明我的证书和 HTTPS 工作正常,并且用户名和密码正确。以下是 web.config 中的相关设置:
<services>
<service name="SecureWcfTestsApplication.Service1">
<endpoint address=""
binding="wsHttpBinding"
bindingConfiguration ="Binding2"
contract="SecureWcfTestsApplication.IService1" />
</service>
</services>
<bindings>
<basicHttpBinding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="Binding2">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="Windows" algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
我正在使用 wsHttpBinding,因为它不喜欢将 clientCredentialType 设置为 Windows 的 basicHttpBinding。话虽如此,我宁愿使用 basicHttp 但它希望 UserName 作为 clientCredentialType,我不确定 UserName 和 Windows 安全之间有什么区别。
最好的
雷
【问题讨论】:
标签: windows wcf security iis anonymous