would appreciate help on this subject:
I'm trying to use my own roles, like I did on MVC4 (custom membership) I.E. [Authorize(roles="Admin")] for some controllers. I'm a bit confused with the new Identity thing.
Later, I will also need to use the same roles for API controllers.
Can someone explain how in the simplest way I can achieve the following thing:
- Read from my SQL DB (entity) a "Login" class, which has Username, Password and a Role. (Role is an Enum of roles, {Admin = 1, Manager = 2...}
- Use the role from my Login, and translate it to use with the new "Identity".
- Manage regular controllers with [Authorize(roles="Admin")], [AllowAnonymous], etc
- Manage API controllers with same thing.
I've read the stuff about customizing, but it seems too complicated.
Anyone has a simple example of how to use it plain and simple?
Thanks