在动作过滤器中访问ApplicationCookies身份声明

问题描述 投票:0回答:1

我正在尝试在ActionFilter中添加一些cookie,这适用于所有调用,而无需初始oauth重定向。我可以通过电话访问ApplicationCookie索赔吗?

我可以在HttpContext.Current.GetOwinContext()。Authentication中看到数据,但是我不知道如何访问它。

  public class CookieActionFilter : ActionFilterAttribute
    {
        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            var identity = HttpContext.Current.User.Identity as ClaimsIdentity;

// NULL On Initial Login
            if (identity != null)
            {


enter image description here

c# asp.net-web-api owin
1个回答
0
投票

可通过]访问>

HttpContext.Current.GetOwinContext()。Authentication.AuthenticationResponseGrant.Identity

© www.soinside.com 2019 - 2024. All rights reserved.