title: ASP.NET MVC and Windows Authentication with custom roles
body: <p>I am trying to implement windows authentication in my ASP.NET MVC2 application.
  I've followed all the steps suggested by the official documentation:</p>
  
  <pre><code>&lt;authentication mode="Windows" /&gt;
  
  &lt;authorization&gt;
    &lt;deny users="?" /&gt;
  &lt;/authorization&gt;
  </code></pre>
  
  <p>I've specified NTLM Authentication. So far so good. Everything works fine. 
  I would like to check the users logged-in against my database. 
  I would like to fetch roles from my table and then manage the authorization using a custom attribute.<br>
  <strong>I don't want to use membership and roles provider.</strong> 
  I'already have my tables Users/Roles in place cause they've been used for an Internet App (this is the Intranet App).  </p>
  
  <p>In my Internet App I had a form where the user inputs the data. The form is posted to a controller which checks everything and creates a cookie with the user (and roles) of the logged-in user.</p>
  
  <p>In my global.asax I've trapped the AuthenticateRequest event where I read the cookie and create a custom principal which I use all over the app to check the authorizations. </p>
  
  <p>How can I do implement this with Windows Authentication?</p>