WCF Service Deployment Question 2 - SecurityNegotiationException - The caller was not authenticated by the service. RRS feed

  • Question

  • This may be an old problem for some as I searched and looked at quite a few Internet discussions on this topic. The solutions they provided, however, did not solve my problem.

    As this happened on many cases, if my WCF service and client are on the same machine, no problem. When the WCF service is running from a remote server, this exception happens.

    I've followed a few suggestions and modified my web.config of the WCF service, but the error persisted. Here is my web.config file. Any help or hint is greatly appreciated.

    <?xml version="1.0"?>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
      <identity impersonate="true" userName="mydomain\myusername" password="mypassword"/>
      <trust level="Full"></trust>
      <compilation debug="true" targetFramework="4.5.1">
            <add assembly="System.Windows.Forms, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <httpRuntime targetFramework="4.5.1"/>
              <security mode="Message">
                <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
              <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="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 name="WcfServiceZamanService.Service1Behavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="false"/>
            <behavior name="web">
          <!-- add binding="basicHttpsBinding" scheme="https"/>-->
          <add binding="wsHttpBinding" scheme="http"/>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
          <service name="WcfServiceZamanService.TrackingService" behaviorConfiguration="WcfServiceZamanService.Service1Behavior">
            <endpoint address="" binding="webHttpBinding" contract="WcfServiceZamanService.ITrackingService" behaviorConfiguration="web">
                <dns value="localhost"/>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <modules runAllManagedModulesForAllRequests="false"/>
            To browse web app root directory during debugging, set the value below to true.
            Set to false before deployment to avoid disclosing web app folder information.
        <directoryBrowse enabled="true"/>

    Monday, August 10, 2015 11:46 PM


All replies