title: WCF error over the internet only
body: <p>I have a WCF problem. Been stuck here for days. </p>
  
  <ul>
  <li>I have my WCF Service and Client working perfectly on the intranet.</li>
  <li>I deployed the same service/client on our IIS server exposed over the internet. This service, i am able to access perfectly from my workstatation, using the internet site (the .com address)</li>
  <li>However, when accessing the same .com site using a computer not connected to our network, it's giving me the dreaded "The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate, NTLM'" when accessing the Service</li>
  </ul>
  
  <p>Other Info: The client authenticates me. When the client is accessing the WCF Service, i get the error.</p>
  
  <p>Client Web.Config:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
    &lt;bindings&gt;
     &lt;basicHttpBinding&gt;
      &lt;binding name="BasicHttpEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00"
       receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="true"
       bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
       maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
       messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
       useDefaultWebProxy="true"&gt;
       &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
       &lt;security mode="TransportCredentialOnly"&gt;
        &lt;transport clientCredentialType="Windows" proxyCredentialType="None"
         realm="" /&gt;
        &lt;message clientCredentialType="UserName" algorithmSuite="Default"  /&gt;
       &lt;/security&gt;
      &lt;/binding&gt;
     &lt;/basicHttpBinding&gt;
    &lt;/bindings&gt;
    &lt;client&gt;
     &lt;endpoint address="http://exposedoutside.com:80/site/myservice.svc"
      binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpoint"
      contract="WFLServiceReference.IWorkflow" name="BasicHttpEndpoint" /&gt;
    &lt;/client&gt;
     &lt;behaviors&gt;
       &lt;endpointBehaviors&gt;
         &lt;behavior name=""&gt;
           &lt;dataContractSerializer maxItemsInObjectGraph="2147483646"/&gt;
           &lt;clientCredentials&gt;
             &lt;windows allowedImpersonationLevel="Impersonation"/&gt;
           &lt;/clientCredentials&gt;
         &lt;/behavior&gt;
       &lt;/endpointBehaviors&gt;
     &lt;/behaviors&gt;
   &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>I didn't really need to specify the port. Also, i added this in the code-behind</p>
  
  <pre><code>Dim wcfService = New WCFServiceProxy.myserviceClient()
  wcfService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation
  </code></pre>
  
  <p>Am i missing something?</p>
  
  <p>Thank you in advance.</p>