首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何将WCF与IIS中的基本basichttpbinding、SSL和基本身份验证一起使用?

如何将WCF与IIS中的基本basichttpbinding、SSL和基本身份验证一起使用?
EN

Stack Overflow用户
提问于 2010-05-25 21:09:34
回答 1查看 53.2K关注 0票数 22

是否可以仅使用BasicHttpBinding-binding在IIS中设置带有SSL和基本身份验证的WCF服务?

(我不能使用wsHttpBinding-binding)

该站点托管在IIS 7上,并设置了以下身份验证:

Windows匿名访问:OFF

  • Basic身份验证:ON

  • Integrated

  • 身份验证:OFF

服务配置:

代码语言:javascript
复制
<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匹配的基地址。注册的基地址方案为

  • 1.。

IIS错误:此服务的安全设置要求‘匿名’身份验证,但没有为承载此服务的

  • 2.应用程序启用此身份验证。

有谁知道如何正确配置它吗?(如果可能的话?)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-05-28 14:32:53

经过一番挖掘,向几位同事提出了一些问题,我们终于解决了问题。

在这种情况下,重要的是要了解安全性的两个方面。IIS安全和WCF安全。

SSL安全性:启用和基本身份验证。禁用匿名身份验证。(当然,在IIS中创建一个windows帐户/组并设置您的应用程序的权限。)

WCF安全:因为绑定只是一个BasicHttpBinding,所以服务不需要验证任何内容。IIS对此负责。

服务的绑定配置:

代码语言:javascript
复制
<bindings>
  <basicHttpBinding>
     <binding>
        <security mode="Transport">
           <transport clientCredentialType="Basic" />
        </security>
     </binding>
  </basicHttpBinding>

最后,为了解决第一个错误,我们删除了mex端点。此终结点需要HTTP绑定。

已删除:

代码语言:javascript
复制
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
票数 25
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2904883

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档