Monday 10 August 2015

Authorization Filter

This filter will be executed once after user is authenticated

We can customize it like:


public class CustAuthFilter : AuthorizeAttribute
    {
        public override void OnAuthorization(AuthorizationContext filterContext)
        {            
            filterContext.Controller.ViewBag.AutherizationMessage = "Custom Authorization: Message from OnAuthorization method.";
        }        
    }



No comments:

Post a Comment