【发布时间】:2015-02-19 02:54:24
【问题描述】:
我们使用出色的 Thinktecture IdentityServer v2 来管理我们的身份验证。这适用于底层 SqlMembershipProvider 架构。我想使用 Identity Server 在令牌中返回的信息(声明)来管理 ASP.NET MVC4 Web 应用程序连接。现在,我只是在 OAuth2Client.RequestResourceOwnerPasswordAsync() 返回 AccessToken 时使用用户名设置授权 cookie。我什至不验证它(这将设置 ClaimsPrincipal.Current),因为它的目的是在我稍后调用的另一个 Web API 上使用它,所以它在这个 Web API 中得到了验证。
如果我验证令牌并将 ClaimsPrincipal.Current.Identity 设置为我得到的那个,那么在每次调用时检索它的机制是什么?我是否必须缓存令牌并在每次请求时再次验证才能获取它?
所有这些的目的是让我在 wep 应用程序方面获得声明,以便我可以基于它们应用授权过滤器。
【问题讨论】:
标签: asp.net-mvc-4 forms-authentication claims-based-identity thinktecture-ident-server