What does [Authorize(Users = “*”)] mean in asp.net mvc

后端 未结 3 736
再見小時候
再見小時候 2021-01-19 01:59

What does [Authorize(Users = \"*\")] mean in asp.net mvc.? Also please explain [Authorize(Users = \"\")] and [Authorize(Users = \"?\")].

3条回答
  •  被撕碎了的回忆
    2021-01-19 02:28

    Looking at the documentation for the attribute it doesn't look like you can use it that way. By default the AuthorizeAttribute only allows access to authenticated and authorised users so passing * (all) or ? (guest) doesn't make sense.
    The Users property is used to further restrict the list of authenticated users who can access the Action method along with the Roles property which can also be used to further filter any authenticated access.

提交回复
热议问题