当我在IIS中将Windows身份验证启用和匿名设置为禁用时,我收到以下错误。
匿名主机上配置的身份验证方案('IntegratedWindowsAuthentication')不允许绑定'BasicHttpBinding‘(’
‘)上配置的身份验证方案。请确保将SecurityMode设置为传输或TransportCredentialOnly。此外,可以通过以下方式解决此问题:通过IIS管理工具更改此应用程序的身份验证方案、通过ServiceHost.Authentication.AuthenticationSchemes属性、在应用程序配置文件中的元素处、通过更新绑定的ClientCredentialType属性或通过调整HttpTransportBindingElement的AuthenticationScheme属性。
我的Wcf服务的web.config如下所示...
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint binding="basicHttpBinding"
bindingConfiguration="BasicHttpEndpointBinding"
contract="Test.IService1" name="BasicHttpEndpoint" />
</client>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceAuthenticationManager
authenticationSchemes="IntegratedWindowsAuthentication"/>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpBinding" scheme="http" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
请指教..
https://stackoverflow.com/questions/15264969
复制相似问题