title: SharePoint, WCF and Anonymous Access
body: <p>Does a WCF service on SharePoint require that Anonymous Access is enabled?</p>
  
  <p>We have an application page which is calling the service using Ajax.Net, if Anon Access is off then we get prompted for the username and password, if it is on then all is well.</p>
  
  <p>We are not using a WCF client, it is purely being called by the scriptmanager</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;webHttpBinding&gt;
          &lt;binding
            name="webHttpBinding_DataSources"
            maxBufferSize="5242880"
            maxReceivedMessageSize="5242880" /&gt;
        &lt;/webHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;behaviors&gt;
        &lt;endpointBehaviors&gt;
          &lt;behavior
            name="ServiceAspNetAjaxBehavior"&gt;
            &lt;enableWebScript /&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior
            name="ServiceBehavior"&gt;
            &lt;serviceMetadata
              httpGetEnabled="true"
              httpGetUrl="" /&gt;
            &lt;serviceDebug
              includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment
        aspNetCompatibilityEnabled="true"/&gt;
      &lt;services&gt;
        &lt;service
            name="XXXXXXXX.DataSources.Services.DataSourceHelper"
            behaviorConfiguration="ServiceBehavior"&gt;
          &lt;endpoint
            address=""
            behaviorConfiguration="ServiceAspNetAjaxBehavior"
            binding="webHttpBinding"
            bindingConfiguration="webHttpBinding_DataSources"
            contract="XXXXXXXX.DataSources.Services.IDataSourceHelper" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Thanks, Phill</p>