I'm running into a case where login code that works in some
environments, and has been working in production for a while, is not
working in a new development environment. I'm wondering if there's an
obvious reason why this method of programmatically logging someone in
wouldn't work (or if there's a better method). We're doing this in code
because our SSO is technically handling the authentication -- if SSO
says the user's good, we just log them into Ektron and send them on to
whatever page they were trying to access.
UserManager um = new UserManager();
System.Web.HttpContext currentContext = System.Web.HttpContext.Current;
UserData ud = um.Login(strUsername, strPassword, currentContext.Request.ServerVariables["SERVER_NAME"]);
//never runs, because IsLoggedIn always returns false
Username and password are definitely right (sending the wrong info for either generates a clear error message). The value in SERVER_NAME looks right to me -- it's the name of the developer VM, same as on my old developer VM which works fine with this code -- but I don't know what it's supposed to get compared to, so I can't be sure. No errors are generated on the Login() call, and the correct user's info is returned to the ud object, but the UserContextService still says they aren't logged in.
Any insight would be appreciated, thanks!