title: Authorization using active directory role provider MVC4
body: <p>I'm building a MVC4 application for internal use in a corporate enviroment. I use windows authentication, which works fine, but I'm having troubles using Active Directory groups as roles for authorization.</p>
  
  <p>My Web.config looks like this:</p>
  
  <pre><code>&lt;authentication mode="Windows" /&gt;        
  &lt;roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider"&gt;
    &lt;providers&gt;
      &lt;clear /&gt;
      &lt;add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /&gt;
    &lt;/providers&gt;
  &lt;/roleManager&gt;        
  &lt;authorization&gt;
    &lt;deny users="?" /&gt;    
  &lt;/authorization&gt;
  </code></pre>
  
  <p>When I use User authorization it works fine:</p>
  
  <pre><code>[Authorize(Users = @"DOMAIN\User1, DOMAIN\User2")]
  public ActionResult Create()
  {
      return View();
  }
  </code></pre>
  
  <p>But when I use roles, it just don't let users in that group to access this action:</p>
  
  <pre><code>[Authorize(Roles = @"Domain\Group")]
  public ActionResult Create()
  {
      return View();
  }
  </code></pre>
  
  <p>I also tried specifying the group without the domain as I read in other replies, but no luck... I guess I'm missing something in the Web.config, but I'm not sure what...</p>
  
  <p>I was avoiding to use a custom role provider because MVC4 is supposed to achieve this without a custom role provider (or at least that's what I thought)</p>
  
  <p>Can anyone help me with this?</p>
  
  <p>Thanks in advance!</p>