I'm trying to write WCF Service which will be searching through Active Directory services. I would like to set this service to use my fixed credentials, so my password would not expire.
This is how my web.config
looks like:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authorization>
<allow users="?"/>
</authorization>
<authentication mode="Windows"/>
<identity impersonate="true" userName="mylogin" password="mypass" />
</system.web>
<system.serviceModel>
<services>
<service name="Mochrie.MyService" behaviorConfiguration="asdf">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="httpBinding" contract="Mochrie.IMyService" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="httpBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="asdf">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Unfortunately I'm receiving well-known error and struggling with it through few days.
While trying to browse on: http://localhost/Mochrie/MyService.svc?wsdl
The authentication schemes configured on the host ('IntegratedWindowsAuthentication') do not allow those configured on the binding 'BasicHttpBinding' ('Basic'). Please ensure that the SecurityMode is set to Transport or TransportCredentialOnly. Additionally, this may be resolved by changing the authentication schemes for this application through the IIS management tool, through the ServiceHost.Authentication.AuthenticationSchemes property, in the application configuration file at the <serviceAuthenticationManager> element, by updating the ClientCredentialType property on the binding, or by adjusting the AuthenticationScheme property on the HttpTransportBindingElement.
Had anyone had a chance to solve this problem and set the wcf service properly?