title: The caller was not authenticated by the service
body: <p>I am using WCF and found this error:</p>
  
  <blockquote>
    <p>" The caller was not authenticated by the service."</p>
  </blockquote>
  
  <p>I have used this code in <code>client.config</code> file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;wsHttpBinding&gt;
          &lt;binding name="WSDualHttpBinding_IReceiverController" closeTimeout="00:00:05"
           openTimeout="00:00:05" receiveTimeout="00:10:00" sendTimeout="00:00:05"
           bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
           maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
           messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
            &lt;reliableSession ordered="true" inactivityTimeout="00:10:00" /&gt;
            &lt;security mode="None"&gt;
              &lt;message clientCredentialType="Windows" negotiateServiceCredential="false" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
          &lt;binding name="WSHttpBinding_IEMRProWCFService" /&gt;
        &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="http://pionbuggs-pc:4567/EMRProWCFService.svc"
          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IEMRProWCFService"
          contract="EMRProWCFService.IEMRProWCFService" name="WSHttpBinding_IEMRProWCFService"&gt;
          &lt;identity&gt;
            &lt;dns value="http://pionbuggs-pc:4567/EMRProWCFService.svc" /&gt;
          &lt;/identity&gt;
        &lt;/endpoint&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>And below is the code in the <code>service.config</code> file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
  
    &lt;system.web&gt;
      &lt;compilation /&gt;
      &lt;httpRuntime maxRequestLength="2147483647" /&gt;
  
    &lt;/system.web&gt;
  
    &lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service name="WCFService.EMRProWCFService"&gt;
          &lt;endpoint address="" binding="wsHttpBinding" contract="WCFService.IEMRProWCFService"&gt;
            &lt;identity&gt;
              &lt;dns value="http://pionbuggs-pc:4567/EMRProWCFService.svc" /&gt;
            &lt;/identity&gt;
          &lt;/endpoint&gt;
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
  
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;!-- 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 --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
      &lt;bindings&gt;
        &lt;webHttpBinding&gt;
          &lt;binding name="WebConfiguration" maxBufferSize="65536" maxReceivedMessageSize="2147483647" transferMode="Streamed"&gt;
          &lt;/binding&gt;
        &lt;/webHttpBinding&gt;
      &lt;/bindings&gt;
    &lt;/system.serviceModel&gt;
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true" /&gt;
      &lt;directoryBrowse enabled="true" /&gt;
    &lt;/system.webServer&gt;
  
  &lt;/configuration&gt;
  </code></pre>