title: Security using the Membership provider that will support Active Directory and your own bespoke provider
body: <p>I have a task of dealing with security on my .Net web application, the way it is to work is that if the user is logged in to Active Directory and the users AD name is in a database then they will be let in.</p>
  
  <p>On the same bases if the users AD name is not in the database then they will be asked to login, with a user name and password, held in the database.</p>
  
  <p>So I need some kind of mix mode security login using the Membership and Role provider.</p>
  
  <p>Where I am having trouble is where do you detect if a user can login using AD, so they get logged in automatically.</p>