title: AuthorizeCore not working for custom authorize attribute
body: <p>I'm trying to use a custom Authorize attribute in my application to handle request from Clients and Administrators.</p>
  
  <p>I've used the same approach in a different application where the only difference was the authentication type. One being Microsoft Account based and this one being Federated Services based.</p>
  
  <p>I've set a break point in my override of the AuthorizationCore method, my problem is that this is only getting fired once when the user tries to access the application for the first time, it will then redirect the user to the login page. After this it does not get fired again. I need it to fire every time a user accesses the controller/action so we can check if the user has the correct role, which in my understanding is the what the Authorize attribute is for.</p>
  
  <p>My code:</p>
  
  <pre><code>public class AuthorizeUserAttribute : AuthorizeAttribute
  {
      /// &lt;summary&gt;
      /// The Role required by the Action or Controller
      /// &lt;/summary&gt;
      public UserRole RequireRole { get; set; }
  
      /// &lt;summary&gt;
      /// Authorization Logic
      /// &lt;/summary&gt;
      /// &lt;param name="httpContext"&gt;&lt;/param&gt;
      /// &lt;returns&gt;&lt;/returns&gt;
      protected override bool AuthorizeCore(HttpContextBase httpContext)
      {
  
          //Result = new AuthorizationResult();
          bool isAuthorized = base.AuthorizeCore(httpContext);
  
          if (isAuthorized)
          {
              using (ApplicationDbContext context = new ApplicationDbContext())
              {
                  ApplicationUser user = context.ApplicationUsers.FirstOrDefault(u =&gt; u.EmailAddress.Equals(httpContext.User.Identity.Name, StringComparison.OrdinalIgnoreCase));
              }
  
  
              // ... Check if user has the required role
          }
  
          return isAuthorized;
      }
  
      /// &lt;summary&gt;
      /// Redirect the user
      /// &lt;/summary&gt;
      /// &lt;param name="filterContext"&gt;&lt;/param&gt;
      protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
      {
          // Handle the request if the user does not have the required role
  
          base.HandleUnauthorizedRequest(filterContext);
      }
  }
  </code></pre>
  
  <p>I'm using the Attribute as follows</p>
  
  <pre><code>    [AuthorizeUser(RequireRole = Core.Models.Users.UserRole.User)]
      public ActionResult Index()
      {
  
          return View();
      }
  </code></pre>
  
  <p>Any help will be appreciated.
  Thanks</p>