0

We host WCF services and asp.net site on the same machine, both in IIS under Network Service account.

Both sites have Anonymous and Windows authentication enabled. The service uses WsHttpBinding

When we call the service from WCF Test Client everything works fine as it sends regular domain user credentials, but when asp.net calls the service we get the exception:

Type : System.ServiceModel.Security.SecurityNegotiationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : The caller was not authenticated by the service.

It seems like NT AUTHORITY\NETWORK SERVICE is not get authenticated, but I do not know why.

Here is config parts:

  <service name="Wumte.Server.Host.EDocumentsCreationNonDual">
    <endpoint address="" binding="wsHttpBinding" contract="Wumte.Server.Host.IEDocumentsCreationNonDual" bindingConfiguration="LargeMessageWsHttpBinding">
      <identity>
        <dns value="localhost"/>
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>


  <wsHttpBinding>
    <binding name="LargeMessageWsHttpBinding" maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
    </binding>        
  </wsHttpBinding>
Pavel Voronin
  • 13,503
  • 7
  • 71
  • 137
  • It's pretty hard to help you debug your issue without the WCF Service `web.config` at the minimum. Code samples may be helpful, too. – idream1nC0de Jul 12 '16 at 13:37
  • You might want to check this post: http://stackoverflow.com/questions/284538/wcf-error-the-caller-was-not-authenticated-by-the-service – Mark Jul 12 '16 at 13:45
  • @Mark Must I provide credentials? Are credential of NT AUTHORITY\NETWORK SERVICE not sent? – Pavel Voronin Jul 13 '16 at 07:21
  • I think if you set the negotiateServiceCredential to false this may work: – Mark Jul 14 '16 at 09:00

0 Answers0