主机上配置的身份验证方案('Basic')不允许在绑定'BasicHttpBinding'上配置的身份验证方案

时间:2015-11-19 12:30:30

标签: c# asp.net wcf

错误

  

主机上配置的身份验证方案(“基本”)不会   允许在绑定'BasicHttpBinding'上配置的那些   ('匿名')。请确保将SecurityMode设置为   运输或运输保险仅限。另外,这可能是   通过更改此应用程序的身份验证方案来解决   通过IIS管理工具,通过   ServiceHost.Authentication.AuthenticationSchemes属性,在   应用程序配置文件在   element,通过更新绑定上的ClientCredentialType属性,   或者通过调整AuthenticationScheme属性   HttpTransportBindingElement。

你知道web.config中的问题在哪里吗?我尝试使用Windows凭据通过基本身份验证登录到WCF。

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <authentication mode="Windows" />
    <customErrors mode="Off"/>
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="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"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <bindings>
      <basicHttpBinding>
        <binding name="basicEndpoint">
          <security mode="Transport" >
            <transport clientCredentialType="Basic"
                       proxyCredentialType="None"
                       realm="" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <add name="BasicAuthHttpModule"
        type="Wt.BasicAuthHttpModule, Wt"/>
    </modules>
  </system.webServer>

</configuration>

enter image description here

0 个答案:

没有答案