I'm trying to login a user to a dnn site from another application. Basically, they go to my custom built site, login with credentials, and I check in DNN first that they can login to the DNN site, then I log them in. I've already handled ensuring the users exist in both my site and DNN. Here's the issue. I've created the web service to log them in and if you browse to it, it logs them in just fine. However, I'm just trying to call this from my application, log them in, and then should they happen to click on a link to the dnn site, they'd already be logged in. Like I said, browsing to the web service url does log the user in, but calling it from my other application does not. I'm assuming it's because browsing to it set's a cookie that just calling the service does not. Any ideas on how I can log the user in manually without them ever having to travel to the DNN site to log in? Here's my login code as of right now //create the status object DotNetNuke.Security.Membership.UserLoginStatus status = new DotNetNuke.Security.Membership.UserLoginStatus(); //set it to fail status = UserLoginStatus.LOGIN_FAILURE; //see if they are a valid user var obj = UserController.ValidateUser(0, username, password, "DNN", PortalSettings.PortalName, hostIp, ref status); if (status == UserLoginStatus.LOGIN_SUCCESS || status == UserLoginStatus.LOGIN_SUPERUSER) { //if they are, log them in and return true UserController.UserLogin(0, obj, PortalSettings.PortalName, hostIp, false); DotNetNuke.Services.Authentication.UserAuthenticatedEventArgs eventArgs = new DotNetNuke.Services.Authentication.UserAuthenticatedEventArgs(obj, username, status, "DNN"); eventArgs.Authenticated = true; System.Web.Security.FormsAuthentication.SetAuthCookie(username, true); return "true"; } else { return "false"; } |