title: Custom HTTP Basic Authentication for ASP.NET Web Services on .NET 3.5/VS 2008
body: <p>I am refactoring a working ASP.NET Web Application to expose Web Services interface using ASP.NET Web Service. According to <a href="https://stackoverflow.com/questions/162376/web-services-authentication-best-practices">Web Services authentication - best practices</a>, Basic Auth over https is the way to go. Let's assume it is, as opposed to doing WS-Security, X509, etc..</p>
  
  <p>On .NET 3.5/VS 2008, what's the simplest way of implementing custom http Basic Authentication (non-Windows account), for example, accepting only if user name is "foo" and password is "bar". Ultimately, I'd like <code>Thread.CurrentPrincipal</code> set.</p>
  
  <p>Do I write my own <code>HttpModule</code> or can this be done simpler?</p>