title: ASP.NET Login via Custom WCF Rest Call
body: <p>I'm writing an admin panel in ASP.NET for an existing set of web service calls. My goal is to use some of the existing login stuff (locking out pages if your not logged in) etc but using my login mechanism. This works by hitting an http post request with a username and password, if you're good you get a session id back, if not you get a 401. Here is the WCF for that:</p>
  
  <pre><code>        [WebInvoke(UriTemplate = "/Login/", Method = "POST")]
          public String Login(User user)
          {     
              // If we are good return sessiond id
              // Otherwise throw 401 etc
  </code></pre>
  
  <p>So to get this working in ASP.Net what is needed?</p>
  
  <p>I think this:</p>
  
  <ul>
  <li>Implement a user that overrides MembershipUser and has a session id in it.</li>
  <li>Implement a membership provider that overrides MembershipProvider and does all the WCF calls etc.</li>
  <li>In the Web.Config set up a custom membership provider.</li>
  </ul>
  
  <p>Is this correct or am I missing something major?</p>