I have created two classes that implement AuthorizeAttribute
.
One is used globally, and I set it on the Global.asax.cs:
filters.Add(new FirstAuthorizeAttribute() { Order = 0 });
The other is called SecondAuthorizeAttribute
and it is used only in some action methods, and I use it as attribute in the methods I want.
[HttpGet]
[SecondAuthorize]
public ActionResult LogOut()
{
FormsAuthentication.SignOut();
Session.Clear();
Session.Abandon();
return Redirect(Url.Content("~/"));
}
The problem is that SecondAuthorizeAttribute
always execute before FirstAuthorizeAttribute
, and I need this one to execute first. The order is not being helpful, how could I do it?