Skip to main content

Posts

Showing posts with the label Custom Authentication and Authorization in ASP.NET MVC

Custom Roles Base Authorization in ASP.NET MVC

Hello everyone, I am going to share the code sample to roles base authorization  and authentication in ASP.Net MVC 5 using FilterAttribute  and AspNetUserRoles . The Steps detail as given below. ASP.NET Forms Authentication namespace Authorize.Controllers {     [Authorize]     public class AccountController : Controller     {         [HttpPost]         [AllowAnonymous]         public async Task <ActionResult> Login(LoginViewModel model, string returnUrl)         {             if (ModelState.IsValid)             {                      int t...