【发布时间】:2015-04-06 15:19:03
【问题描述】:
我实现了 OWIN 不记名令牌授权,并基于这篇文章:http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/,现在我想将角色添加到不记名令牌,以便我可以像使用用户名一样在控制器上检索它。 .identity.AddClaim(new Claim(ClaimTypes.Name, context.UserName)); 并且能够通过User.Identity.Name 获取当前用户的用户名
【问题讨论】:
标签: asp.net asp.net-web-api access-token user-roles bearer-token