I Have a custom Authorize Attribute, that simply looks like this so far: (I'll add more logic later. I just want to see this work first).
public class CustomAuthorizeAttribute : AuthorizeAttribute
{
public override void OnAuthorization(AuthorizationContext filterContext)
{
base.OnAuthorization(filterContext);
}
}
Then I place my attribute onto a controller:
[CustomAuthorize(Order = 0)]
public class MyController : Controller
Now,
This all works well & dandy, until my forms authentication runs out.
I.E
<forms loginUrl="~/myController/myMethod" timeout="30" /> // this timout expires.
After this timeout, my custom authorize attribute no longer gets hit, instead, it seems that the forms auth module takes over.
After the timeout, the forms auth module just returns the view rendered by the action specified in the webconfig code above.
I'd like to intercept the onAuthorize action when the timeout has expired, so I can interrogate the HttpContext for certain things, and conditionally redirect the user.
Has anyone done something similar?