【发布时间】:2017-05-20 12:35:26
【问题描述】:
我正在使用 Microsoft.Owin.Security.Jwt nuget 包来保护我的 webapi。当我将令牌作为请求头传递给 webapi 时,它会按预期设置 HttpContext.Current.User。
由于业务逻辑被封装,我找不到设置 HttpContext.Current.User 的那一刻。
我不想一直使用 identity.Claims 搜索正确的声明,而是想提取我需要的信息,并将自定义类设置为 HttpContext.Current.User。是否可以使用 Microsoft.Owin.Security.Jwt?
【问题讨论】:
标签: asp.net-web-api oauth-2.0 asp.net-web-api2 owin jwt