4Manuals

  • PDF Cloud HOME

登录后,Actioncontext始终为false(Webapi授权) Download

    谁能帮助我通过wordpress登录和注册来创建React Native应用? 将用户直接添加到/ etc / shadow并期望它能工作,是否可以这样工作? 登录后重定向页面 Django:即使密码另存为哈希,check_password返回false 任何SMTP服务器都可以将邮件发送到任何其他SMTP服务器吗? 通过Web API使用CSOM在SharePoint Server中对用户进行身份验证 有没有办法通过终端对Google API的OAUTH2.0进行身份验证? 将JSON对象中的嵌套数组的数据转换或格式化为TypeScript中用于绑定Kendo网格的嵌套JSON对象 在应用程序内部以及通过外部应用程序对api的调用会返回不同的结果 MongoDB Compass无法连接到服务器,但是命令行可以正常工作

代码: identity null

代码:enter image description here

此方法中的actioncontext变量在登录后始终为

protected override void HandleUnauthorizedRequest(System.Web.Http.Controllers.HttpActionContext actionContext)
        {

            ClaimsPrincipal icp = Thread.CurrentPrincipal as ClaimsPrincipal;
            ClaimsIdentity claimsIdentity = (ClaimsIdentity)icp.Identity;
            bool isAuthenticated = icp.Identity.IsAuthenticated;
          
           if (!HttpContext.Current.User.Identity.IsAuthenticated)
            {
                base.HandleUnauthorizedRequest(actionContext);
            }
            else
            {
                actionContext.Response = new System.Net.Http.HttpResponseMessage(System.Net.HttpStatusCode.Forbidden);
            }
            
        }

0 个答案:

没有答案



Similar searches
    我正在尝试学习如何在c ++中传递指针,但出现错误:没有匹配的函数来调用“测试”。我究竟做错了什么? 具有访问权限的发票跟踪 Samsung RF261BEAEBC Refrigerator User Manual 如果连接断开或超时或服务器关闭,是否选择更新锁定释放? Python是否有处理表单的方法?