ASP.NET web api - Set custom IIdentity or IPrincipal

后端 未结 4 1477
醉梦人生
醉梦人生 2021-02-09 06:49

In our asp.net mvc/web api project, we want to customize the authorization using AuthorizeAttribute. We have noticed that there are two different AuthorizeAtt

4条回答
  •  时光取名叫无心
    2021-02-09 06:56

    I remember that in WebApi I could only use ControllerContext. But I'm not sure exactly why. From What I read, HttpContext is thread static, but everything in WebApi is more or less async. Take a look at this topic, maybe it will answer some questions.

提交回复
热议问题