I recently begun to migrate a ASP.Net MVC 2 project to MVC 4. Now it seems that all worked fine (as far as I can tell for now) except my custom Authorize Attribute, this didn’t get called at all.
Class
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public class Authenticated : AuthorizeAttribute
Sample ussage
[Authenticated]
public ActionResult ChangePassword(string password)
Has there been any changes? What am I missing?
Edit
How would I debug this, when the Attribute methods self didn’t get called?
No, there aren’t any changes in respect to custom action filters. Assuming you have controller/actions decorated with this attribute the
OnAuthorizationwill always be called.