title: WCF & ASP.NET Membership Provider
body: <p>I know for WCF to work with a membership provider you have to explicitly configure it: (e.g. <a href="http://www.codewrecks.com/blog/index.php/2009/09/08/use-aspnet-membership-provider-with-a-wcf-svc-service/" rel="nofollow noreferrer">http://www.codewrecks.com/blog/index.php/2009/09/08/use-aspnet-membership-provider-with-a-wcf-svc-service/</a>)</p>
  
  <p>But if you already have the ASP.NET site using it, can't you prevent anonymous access to the service simply by doing the following?</p>
  
  <pre><code>  &lt;location path="PathToWCFService"&gt;
      &lt;system.web&gt;
        &lt;authorization&gt;
          &lt;deny users"?" /&gt;
          &lt;allow users="*" /&gt;
        &lt;/authorization&gt;
      &lt;/system.web&gt;
    &lt;/location&gt;
  </code></pre>
  
  <p>Assuming this works, then I would guess WCF wouldn't have access to the membership information?  Any other reasons why this might be a bad idea?  Thanks!</p>
  
  <p><strong>Edit:</strong> Any other way to use WCF with the membership provider that doesn't require maintaining a certificate?</p>