是否可以仅使用BasicHttpBinding-binding
在IIS中设置带有SSL和基本身份验证的WCF服务?
(我不能使用wsHttpBinding-binding
)
该站点托管在IIS 7上,并设置了以下身份验证:
Windows匿名访问:OFF
服务配置:
<services>
<service name="NameSpace.SomeService">
<host>
<baseAddresses>
<add baseAddress="https://hostname/SomeService/" />
</baseAddresses>
</host>
<!-- Service Endpoints -->
<endpoint address="" binding="basicHttpBinding"
bindingNamespace="http://hostname/SomeMethodName/1"
contract="NameSpace.ISomeInterfaceService"
name="Default"
/>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
<exceptionShielding/>
</behavior>
</serviceBehaviors>
</behaviors>
我尝试了两种类型的绑定,但出现了两个不同的错误:
https IIS错误:‘无法找到与具有绑定BasicHttpBinding的终结点的方案http匹配的基地址。注册的基地址方案为
IIS错误:此服务的安全设置要求‘匿名’身份验证,但没有为承载此服务的
有谁知道如何正确配置它吗?(如果可能的话?)
发布于 2010-05-28 14:32:53
经过一番挖掘,向几位同事提出了一些问题,我们终于解决了问题。
在这种情况下,重要的是要了解安全性的两个方面。IIS安全和WCF安全。
SSL安全性:启用和基本身份验证。禁用匿名身份验证。(当然,在IIS中创建一个windows帐户/组并设置您的应用程序的权限。)
WCF安全:因为绑定只是一个BasicHttpBinding,所以服务不需要验证任何内容。IIS对此负责。
服务的绑定配置:
<bindings>
<basicHttpBinding>
<binding>
<security mode="Transport">
<transport clientCredentialType="Basic" />
</security>
</binding>
</basicHttpBinding>
最后,为了解决第一个错误,我们删除了mex端点。此终结点需要HTTP绑定。
已删除:
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
https://stackoverflow.com/questions/2904883
复制相似问题