Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to MVC, I have tables with users and their roles, please suggest me how to implement authorization in MVC with Code examples.

What I have tried:

I want to authenticate user then get the role from database and based on the role I want to redirect user to their controllers or areas based on conditions.

Any code example will help me a lot, as I am not sure how to implement it in MVC with provider self service.
Posted
Updated 5-Dec-19 5:28am
v2
Comments
F-ES Sitecore 27-Nov-19 11:49am    
This topic is extensively documented. I'd recommend you just use the authorisation built in to the new project wizard rather than rolling your own, that gets you a lot of things for free. Then google how to write your own authorisation filters, lots of articles out there.
Divyay208 27-Nov-19 12:14pm    
How we can implement this authorization process like 'MembershipService' in web-forms?

1 solution

 
Share this answer
 
Comments
Divyay208 3-Dec-19 11:49am    
I got to know how to implement custom authentication using provider self service from the above article.. IS there any way to use existing tables to implement default ASP .net provider member service in MVC

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900