Web 应用程序和 ISA 身份验证出现问题

本文关键字:问题 身份验证 ISA 应用程序 Web | 更新日期: 2023-09-27 18:37:00

现在,此代码通过选取经过身份验证的用户(Windows身份验证)来工作。 我们正在使用活动目录。 但是,如果您脱离网络并尝试登录此特定应用程序,您将被重定向到我们的ISA 2006服务器,然后将登录信息传递到应用程序中(理论上,大声笑)

当我通过 3G 在手机上访问此应用程序时,它非常慢,但我没有收到错误(错误只是一个带有 OK 按钮的弹出窗口,有时它说错误,有时它没有)。但是,当我使用比外部更快更好的计算机时,它确实会给我此错误。我的同事的单元测试显示存在某种递归循环或某种给出错误的循环。每当您在网络上登录 Web 应用程序时,它都会毫无问题地获取 Windows 身份验证,并且不会给出任何错误。我花了 3 天时间试图找出我的错误但找不到它,我希望另外几双眼睛可以帮助我追踪它(我正在使用 C# ASP.net 4.0)

public string IdentifyUser()
    {
        string retval = string.Empty;
        try{

               //System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;
                //string UserIdentityName = p.Identity.Name;
                string UserIdentityName = Request.ServerVariables["AUTH_USER"];
                //string UserIdentityName = HttpContext.Current.User.Identity.Name.ToString();
                string slash = @"'";
                string Username = UserIdentityName.Substring(UserIdentityName.IndexOf(slash) + 1);
                retval = Data_Access_Layers.SQL.GetUserID(Username);


           }
        catch (Exception ex)
        {
            throw ex;
        }
        return retval;
    }

基本上,这会触发,提取用户名,它被发送到"GetUserID",该"GetUserID"查找该用户名并发回附加到该人的用户ID,然后将其发送回主页,并存储在javascript变量中(用于页面的其他部分)

Web 应用程序和 ISA 身份验证出现问题

AUTH_USER的问题

是否为空?

从网络内部和外部访问应用程序时,AUTH_TYPE标头的值是多少?