I am creating an application which is going to use windows authentication to allow access to page based on user and its roles. I have gone ahead and configured IIS to use windows authentication and disabled anonymous access. I am able to browse the application without any issue and I have successfully enabled windows authentication for the application.
Now I am trying to set access to controller level by using
Authorize, but I am unable to figure it out how it works with ASP.net 5. I am completely new to ASP / C# programming platform but I did search online resources and I came across this and I used below example to give it a try but I get red squiggly line under
users and I think ASP.NET 5 is unable to find
users. I also made sure that I have added all the references at the top.
[Authorize(Users = @"CONTOSO\Rick, CONTOSO\Keith, CONTOSO\Mike")]
Any suggestions is highly appreciated. :)
public class TutorialsController : Controller
[Authorize(Roles = @"DOMAIN\GROUP")]
public IActionResult Index()
Tutorial Index View:
Visual studio project settings: