Issue with Web Application and ISA Authentication

514 Views Asked by At

right now this code works by picking up the authenticated user (windows authentication). we are using active directory. however if you are off the network and try to log into this specific application you get redirected to our ISA 2006 server, which then passes login information into the application (in theory, lol)

when I access this app on my phone over 3g its pretty slow, but i dont get an error (the error just being a popup with an ok button, sometimes it says error, sometimes it doesnt). However when I use a faster better computer over the external it does give me this error. Unit testing by my colleagues revealed there to be some sort of recursive loop or some sort which was giving the error. any time you log into the web application while on the network, it picks up windows authentication with no problem and gives no error. I have spent 3 days trying to figure out my bug but cant find it, I hope another few set of eyes can help me track it down (I am using ASP.net 4.0 with C#)

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;
    }

basically this fires off, pulls the username, it gets sent to "GetUserID" which looks up that username and sends back the user id attached to that person, which is then sent back out to the main page, and is stored in a javascript variable (to be used on other parts of the page)

1

There are 1 best solutions below

5
C.M. On

Is the problem that AUTH_USER is empty?

What is the value of the AUTH_TYPE header when accessing the app from inside and outside the network?