Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc NETMVC&;代理及;Active Directory身份验证。如何提高绩效?_Asp.net Mvc_Asp.net Mvc 3_Iis_Active Directory_Iis 7.5 - Fatal编程技术网

Asp.net mvc NETMVC&;代理及;Active Directory身份验证。如何提高绩效?

Asp.net mvc NETMVC&;代理及;Active Directory身份验证。如何提高绩效?,asp.net-mvc,asp.net-mvc-3,iis,active-directory,iis-7.5,Asp.net Mvc,Asp.net Mvc 3,Iis,Active Directory,Iis 7.5,我对在active directory环境中开发相当陌生。所以请容忍我 [A] 我一直在运行fiddler来浏览我网站上的一些页面,我注意到了以下几点 [B] 据我所知,401错误是由NTLM的工作方式引起的 [C] 但我也支持一个代理,所以我也得到了这些回复 我还注意到,fiddler中的auth选项卡为 代理结果。[C] 代理身份验证标头存在:协商 存在代理身份验证标头:Kerberos 存在代理身份验证标头:NTLM 不存在WWW身份验证标头 401.2结果[B] 不存在代理身份验

我对在active directory环境中开发相当陌生。所以请容忍我

[A] 我一直在运行fiddler来浏览我网站上的一些页面,我注意到了以下几点

[B] 据我所知,401错误是由NTLM的工作方式引起的

[C] 但我也支持一个代理,所以我也得到了这些回复

我还注意到,fiddler中的auth选项卡为

代理结果。[C]

代理身份验证标头存在:协商

存在代理身份验证标头:Kerberos

存在代理身份验证标头:NTLM

不存在WWW身份验证标头

401.2结果[B]

不存在代理身份验证标头

WWW身份验证标头存在:协商

WWW身份验证标头存在:NTLM

注意:在我的控制器中,我有一个从AuthorizeAttribute类继承的自定义Authorize属性

现在我的问题是。。。是否可以减少一些401结果和代理结果,因为它们似乎会导致性能问题

以及


是否可以对401和代理结果应用gzip/deflate压缩以减小其大小?

好的,我不是网络管理员。所以请不要引用我的话,但以下是我认为已经发生的事情。我们的网络上有多个域控制器,我认为它们可以在彼此之间来回传递请求。从那时起,安装已经改变了,对于服务器授权问题,不必要的调用似乎已经消失/减少了

,考虑在Web.CONFIG中使用位置标签使文件位置公开。
        protected override bool AuthorizeCore(HttpContextBase httpContext)
    {
        if (base.AuthorizeCore(httpContext))
        {
            /* Return true immediately if the authorization is not 
            locked down to any particular AD group */
            if (Groups == null)
                return true;

            //admin user -> allow all actions
            if (IsUserInRole("Admin"))
            {
                return true;
            }
            else
                //Domain_Users -> continue for division level permissions
                if (IsUserInRole("Production_Users") || IsUserInRole("Engineering_Users") || IsUserInRole("Quality_Users"))
                {
                    //if we've gotten here, the user is a domain user & in a specific division,
                    //depending on the view we're dealing with, and the users permissions allow/deny
                    switch (httpContext.ApplicationInstance.Request.RequestContext.RouteData.Values["action"].ToString())
                    {
                        case "Add":
                            return HttpContext.Current.User.IsInRole(GetGroupFromAppConfig("AddAllow"));
                        case "Edit":
                            return HttpContext.Current.User.IsInRole(GetGroupFromAppConfig("EditAllow"));
                        case "Delete":
                            return HttpContext.Current.User.IsInRole(GetGroupFromAppConfig("Deletellow"));
                        default:
                            //default = no action type is specified => we're dealing with a "view" 
                            //& as the user has division level permissions, allow.
                            return true;
                    }
                }
                else
                {
                    return false;
                }

        }
        return false;
    }