I am adding ASP.NET MVC to an existing WebForms application. So far, I do not need authentication / registration, as this part is processed by existing code (forms authentication).
In the existing WebForms application, we have fully custom authorization based on page permissions. Thus, each user has a set of rights, listing the pages to which he is allowed access.
Now I need to decide how I can use the same permission system to restrict access to certain controllers and MVC actions.
As I understand it, for ASP.NET MVC there is a standard AuthorizeAttribute where I can specify roles. I also found some articles that suggest specifying permissions instead of roles - then you can do something like this:
[CustomAuthorize(Roles = "View products, Edit products")]
By extending AuthorizeAttribute, I can also determine how I store and get permissions.
This solution would be acceptable to me (although changing the semantics of roles smells a bit).
But before doing this, I would like to see what other options are. And where am I stuck - I did not find a full-blown overview of the various authorization approaches in ASP.NET MVC. I would also like to know how all security concepts (e.g. Form Authentication, Membership Providers, Authorization Attribute, IPrincipal, etc.) are related to each other and how they should work together.
Dmytro shevchenko
source share