kers7754 Posted July 21, 2011 Share Posted July 21, 2011 I am using the API to call validate login and it is working. Once the call returns with a success, I set session like so: session_start(); // at the top of course $_SESSION['uid'] = $results["userid"]; $_SESSION['upw'] = $results["passwordhash"]; But when I redirect to the WHMCS backend site, whmcs doesn't believe I am logged in. I did a print_r on the $results and see a valid userid and passwordhash. Maybe Validate Login doesn't actually log in a user? 0 Quote Link to comment Share on other sites More sharing options...
jeremyhaber Posted July 21, 2011 Share Posted July 21, 2011 If you are asking if the API call will log the user in. It wont automatically. You will need to checkout to see what session variables are required for a user login. I am pretty sure there are more variables set then those two you mentioned and "upw" I don't believe is one of them. Though it could be... Also check out AutoAuth it was developed for this purpose of logging a user into your site. 0 Quote Link to comment Share on other sites More sharing options...
kers7754 Posted July 21, 2011 Author Share Posted July 21, 2011 So in my tests, the autoauth will always succeed and doesn't need a password. I would need to call into the API to authenticate (using validateuser) and if successful, do the autoauth. Correct? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted July 22, 2011 WHMCS CEO Share Posted July 22, 2011 To get the validatelogin API returned session variables working you might need to disable "Session IP Checking" in General Settings > Security. But otherwise yes, you could validate the email & password using the API call and then just generate and redirect to an AutoAuth URL to log the user in. Matt 0 Quote Link to comment Share on other sites More sharing options...
kers7754 Posted July 25, 2011 Author Share Posted July 25, 2011 Great, thanks! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.