Roles available with Windows Authentication

后端 未结 4 1838
旧时难觅i
旧时难觅i 2021-01-31 22:30

I\'m trying to add Roles authentication to an Action in a Controller in an ASP.NET MVC application. The code looks something like this:

[Authorize(Roles = \"Some         


        
4条回答
  •  一个人的身影
    2021-01-31 22:46

    I'm guessing you aren't using a role provider here, but falling back on the underlying functionality of WindowsPrincipal where the roles map to the user's groups. Anyhow, I don't think one can do more than enumerate the windows groups available on that machine/in that domain. Not sure if this helps, but that's all I can say without having an idea of what you are trying to do with said roles list.

提交回复
热议问题