ASP.NET MVC 5

ASP.NET MVC 5 with Razor Kendo UI: Dynamic Grid Creation – Columns, Ordering, Grouping and Paging

The requirements were simple! A grid that will load a whatever query, grouped by whatever columns, with filters enabled, paging and everything. Easy task with ASP.NET Telerik grids but not easy at all with Kendo UI!

Since we can’t have a ViewModel or Model for the grid (we don’t know what columns a whatever query has!), I came up with a rather different ViewModel that holds descriptions for columns, groups etc…:

Read More »ASP.NET MVC 5 with Razor Kendo UI: Dynamic Grid Creation – Columns, Ordering, Grouping and Paging

ASP.NET MVC 5: Custom AuthorizeAttribute for custom authentication

In a previous post I wrote about how you can should protect your web app from human errors made by developers, by enforcing authentication by default.

Since adding the AuthorizeAttribute to every action involves global filters, we can use that to add our own custom authentication, by inheriting AuthorizeAttributeand overriding the AuthorizeCore and HandleUnauthorizeRequest methods.

Read More »ASP.NET MVC 5: Custom AuthorizeAttribute for custom authentication

ASP.NET MVC 5: “Authorization” by default for your web app

Securing your MVC app is a tricky business! Although security is a huge topic, one of the problems that you might encounter is that unauthenticated users are allowed by default to execute every action in your web app. That behaviour is potentially unsafe because you have to remember to decorate your actions with the authorize attribute, and humans are prone to errors!

This is why, in my opinion, authentication should be enforced by default, or differently [Authorize] attribute should be added behind the scenes to every action.

Read More »ASP.NET MVC 5: “Authorization” by default for your web app