Jacob Mason
Jacob Mason

Reputation: 1405

Simple role based authentication ASP MVC?

I'm trying to implement role based authentication, in my AuthController I have retrieved the user's Windows username and checked it against the database users table to find their record, now that I have found their role I want to assign it to them so that they can access protected routes. What is the simplest way to achieve this?

Right now all I am doing in the AuthController is setting their auth cookie.

Upvotes: 1

Views: 493

Answers (1)

Andrei
Andrei

Reputation: 44600

The best and correct way is to use ASP.NET MVC Identity Framework. It is designed to handle authentication and authorization of MVC apps. It supports role based auth. You can start from here.

Upvotes: 1

Related Questions