title: WCF - Windows authentication - Security settings require Anonymous
body: <p>I am struggling hard with getting WCF service running on IIS on our server. After deployment I end up with an error message:</p>
  
  <p><em>Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.</em> </p>
  
  <p>I want to use Windows authentication and thus I have Anonymous access disabled. Also note that there is aspNetCompatibilityEnabled (if that makes any difference).</p>
  
  <p>Here's my web.config:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" /&gt;
      &lt;bindings&gt;
          &lt;webHttpBinding&gt;
              &lt;binding name="default"&gt;
                  &lt;security mode="TransportCredentialOnly"&gt;
                      &lt;transport clientCredentialType="Windows" proxyCredentialType="Windows"/&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
          &lt;/webHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;behaviors&gt;
          &lt;endpointBehaviors&gt;
              &lt;behavior name="AspNetAjaxBehavior"&gt;
                  &lt;enableWebScript /&gt;
                  &lt;webHttp /&gt;
              &lt;/behavior&gt;
          &lt;/endpointBehaviors&gt;
          &lt;serviceBehaviors&gt;
              &lt;behavior name="defaultServiceBehavior"&gt;
                  &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" /&gt;
                  &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
                  &lt;serviceAuthorization principalPermissionMode="UseWindowsGroups" /&gt;
              &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;services&gt;
          &lt;service name="xxx.Web.Services.RequestService" behaviorConfiguration="defaultServiceBehavior"&gt;
              &lt;endpoint behaviorConfiguration="AspNetAjaxBehavior" binding="webHttpBinding"
               contract="xxx.Web.Services.IRequestService" bindingConfiguration="default"&gt;
              &lt;/endpoint&gt;
              &lt;endpoint address="mex" binding="mexHttpBinding" name="mex" contract="IMetadataExchange"&gt;&lt;/endpoint&gt;
          &lt;/service&gt;
      &lt;/services&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>I have searched all over the internet with no luck. Any clues are greatly appreciated.</p>