MVC 4 application goes to login page first using Windows auth when run

前端 未结 4 2109
我在风中等你
我在风中等你 2021-01-26 12:14

I am currently developing a project that will use Windows authentication to authorize users and set their specific permissions. However, every time I run the program to test, t

4条回答
  •  情书的邮戳
    2021-01-26 12:46

    Is there extra controls in the controller that would specify a user has to be logged in before accessing any pages?

    Example

    [Authorize(Roles = "admin")] // this can even be declared at the top of the controller and the controllers will force all to login.
    public ActionResult TheController()
    {
      //TODO
    }
    

提交回复
热议问题