I have an IIS-enabled WCF service with the following binding configuration (I removed all attributes from the binding for the space) for wsHttpBinding and TransportWithMessageCredential
<wsHttpBinding> <binding name="BindingName" .../> <security mode="TransportWithMessageCredential"> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </wsHttpBinding>
with service behavior:
<serviceBehaviors> <behavior name="ServiceBehavior"> <serviceCredentials> <userNameAuthentication userNamePasswordValidationMode="Windows" /> </serviceCredentials> </behavior> </serviceBehaviors>
Anonymous authentication is disabled and Windows authentication is enabled.
On the client side, credentials are set using a valid Windows user and password, but I get the following exception on every service call:
An HTTP request is not authorized using the 'Anonymous' client authentication scheme. The authentication header received from the server was Negotiation, NTLM. ---> System.ServiceModel.Security.MessageSecurityException: The HTTP request was not authorized using the Anonymous client authentication scheme. The authentication header received from the server was Negotiation, NTLM. ---> System.Net.WebException: the remote server returned an error: (401) Unauthorized.
With its own version of the WCF service, it works fine under a valid Windows account.
Any help is appreciated.
source share