title: How do I restrict access to some methods in WCF?
body: <p>I am a bit lost getting started with a simple WCF service.  I have two methods and I want to expose one to the world and the second one I want to limit to certain users.  Eventually I want to be able to use a client application to use the restricted method.  So far I can access both methods anonymously:</p>
  
  <p><strong>C# Code</strong></p>
  
  <pre><code>namespace serviceSpace
  {
      [ServiceContract]
      interface ILocationService
      {
          [OperationContract]
          string GetLocation(string id);
  
          [OperationContract]
          string GetHiddenLocation(string id);
      }
  
      [AspNetCompatibilityRequirements(
       RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
      public class LocationService : ILocationService
      {
          [WebGet(UriTemplate = "Location/{id}")]
          public string GetLocation(string id)
          {
              return "O hai, I'm available to everyone.";
          }
  
          // only use this if authorized somehow
          [WebGet(UriTemplate = "Location/hush/{id}")]
          public string GetHiddenLocation(string id)
          {
              return "O hai, I can only be seen by certain users.";
          }
  
  
      }
  }
  </code></pre>
  
  <p><strong>Configuration</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0" /&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"/&gt;    
      &lt;standardEndpoints&gt;
        &lt;webHttpEndpoint&gt;
          &lt;standardEndpoint name="" helpEnabled="true" 
            automaticFormatSelectionEnabled="true"/&gt;
        &lt;/webHttpEndpoint&gt;
      &lt;/standardEndpoints&gt;
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>How do I get started?</p>