【问题标题】:Managing ClaimsPrincipal.Current in Forms Authentication MVC app在表单身份验证 MVC 应用程序中管理 ClaimsPrincipal.Current
【发布时间】: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


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-06-19
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多