title: WCF - The HTTP request was forbidden with client authentication scheme 'Anonymous'
body: <p>I know this is a very common scenario, but I've still, after two days of searching, not found a solution to this problem.</p>
  
  <p>I've got a WCF Service and a client (web site), using SSL and a client certificate.</p>
  
  <p>Relevant service config section:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
          &lt;basicHttpBinding&gt;
              &lt;binding name="HOLBinding"&gt;
                  &lt;security mode="Transport"&gt;
                      &lt;transport clientCredentialType="Certificate" /&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
          &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="HOLServiceBehaviour"&gt;
            &lt;serviceCredentials&gt;
              &lt;clientCertificate&gt;
          &lt;authentication certificateValidationMode="PeerOrChainTrust" trustedStoreLocation="LocalMachine" /&gt;
          &lt;/clientCertificate&gt;
            &lt;/serviceCredentials&gt;
            &lt;serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
  &lt;services&gt;
        &lt;service name="HOL.Core.Service.HOLService" behaviorConfiguration="HOLServiceBehaviour"&gt;
          &lt;endpoint address="bh" bindingConfiguration="HOLBinding" binding="basicHttpBinding" contract="HOL.Core.Service.IHOLService" /&gt;
          &lt;endpoint address="wb" behaviorConfiguration="WebBehaviour" binding="webHttpBinding" contract="HOL.Core.Service.IHOLService" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
  </code></pre>
  
  <p>Relevant client service config:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;endpointBehaviors&gt;
          &lt;behavior name="HOLServiceEndpointBehaviour"&gt;
            &lt;clientCredentials&gt;
              &lt;clientCertificate storeLocation="LocalMachine" 
                     findValue="mythumbprint" 
                                 x509FindType="FindByThumbprint" storeName="TrustedPeople" /&gt;
  
              &lt;serviceCertificate&gt;
                 &lt;authentication certificateValidationMode="PeerOrChainTrust"/&gt;
              &lt;/serviceCertificate&gt;
            &lt;/clientCredentials&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="BasicHttpBinding_IHOLService" maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000"&gt;
              &lt;security mode="Transport"&gt;
          &lt;transport clientCredentialType="Certificate" /&gt;
           &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="https://www.myhttpsite.co.uk/Service/HOLService.svc/bh" binding="basicHttpBinding" 
                  bindingConfiguration="BasicHttpBinding_IHOLService" contract="HOLCoreService.IHOLService" 
                  name="BasicHttpBinding_IHOLService" behaviorConfiguration="HOLServiceEndpointBehaviour"&gt;
      &lt;/endpoint&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>My certificate is being found, so that's not the problem (took me a day to fix that problem too!)</p>
  
  <p>I believe the error is that the client calling the WCF Service simply isn't sending through the correct details to authenticate... but why?</p>