title: when negotiateServiceCredential set to false WCF client gets: An unsecured or incorrectly secured fault was received from the other party
body: <p>I built a WCF service that uses wsHttpBinding and a client that invokes it.
  <br/>But I still getting the following error message:</p>
  
  <pre><code>An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
  </code></pre>
  
  <p>and the inner exception is:</p>
  
  <pre><code>An error occurred when processing the security tokens in the message.
  </code></pre>
  
  <p>here is the config file of the service:</p>
  
  <pre><code>   &lt;configuration&gt;
       &lt;system.serviceModel&gt;
         &lt;bindings&gt;
           &lt;wsHttpBinding&gt;
             &lt;binding name="myWsBinding"&gt;
               &lt;security&gt;
                 &lt;message negotiateServiceCredential="false" algorithmSuite="Basic128"
                   establishSecurityContext="false" /&gt;
               &lt;/security&gt;
             &lt;/binding&gt;
           &lt;/wsHttpBinding&gt;
         &lt;/bindings&gt;
         &lt;services&gt;
           &lt;service behaviorConfiguration="ServiceBehavior" name="HelloWorldService.HelloService"&gt;
             &lt;endpoint address="" binding="wsHttpBinding" bindingConfiguration="myWsBinding"
               contract="HelloWorldService.IHelloService"&gt;
               &lt;identity&gt;
                 &lt;servicePrincipalName value="host/MAGBAREYA"/&gt;
               &lt;/identity&gt;
             &lt;/endpoint&gt;
             &lt;host&gt;
               &lt;baseAddresses&gt;
                 &lt;add baseAddress="http://localhost:8999/myService" /&gt;
               &lt;/baseAddresses&gt;
             &lt;/host&gt;
           &lt;/service&gt;
         &lt;/services&gt;
         &lt;behaviors&gt;
            &lt;serviceBehaviors&gt;
              &lt;behavior name="ServiceBehavior"&gt;
                &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
                &lt;serviceMetadata httpGetEnabled="true"/&gt;
              &lt;/behavior&gt;
            &lt;/serviceBehaviors&gt;
          &lt;/behaviors&gt;
        &lt;/system.serviceModel&gt;
      &lt;/configuration&gt;
  </code></pre>
  
  <p>and here is the client config file:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
      &lt;system.serviceModel&gt;
          &lt;bindings&gt;
              &lt;wsHttpBinding&gt;
                  &lt;binding name="WSHttpBinding_IHelloService"&gt;
                      &lt;security mode="Message"&gt;
                          &lt;message clientCredentialType="Windows" negotiateServiceCredential="false"
                              algorithmSuite="Basic128" establishSecurityContext="false" /&gt;
                      &lt;/security&gt;
                  &lt;/binding&gt;
              &lt;/wsHttpBinding&gt;
          &lt;/bindings&gt;
          &lt;client&gt;
              &lt;endpoint address="http://localhost:8999/myService" binding="wsHttpBinding"
                  bindingConfiguration="WSHttpBinding_IHelloService" contract="ServiceReference1.IHelloService"
                  name="WSHttpBinding_IHelloService"&gt;
                  &lt;identity&gt;
                      &lt;servicePrincipalName value="host/MAGBAREYA"/&gt;
                  &lt;/identity&gt;
              &lt;/endpoint&gt;
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The problematic configuration is: negotiateServiceCredential="false".
  <br/>if I set it to true in both service and client the client will work perfectly.(with the above configuration files as they are except of this change)</p>
  
  <p>can anyone tell what do I miss here?</p>
  
  <p>Thanks in advance.</p>