How require authorization within whole ASP .NET MVC application
Simplest way is to add Authorize attribute in the filter config to apply it to every controller. public class FilterConfig { public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new HandleErrorAttribute()); //Add this line filters.Add(new AuthorizeAttribute()); } } Another way is to have all of your controllers inheriting from a base class. This is something I do … Read more