craigedmonds Posted May 31, 2021 Share Posted May 31, 2021 I want to be able to verify admin users through an external api I am building. There already exists an api for clients called: ValidateLogin and in the api doc appears a page for it API:Get Admin Details but page is empty. See: https://docs.whmcs.com/API:Get_Admin_Details My question is: does anyone have any code I can use to pass a username and password to the database and verify them? I can see that the password is encrypted and hashed inside of tbladmins and not sure what php code or query I can use to validate the admin details. TIA 0 Quote Link to comment Share on other sites More sharing options...
craigedmonds Posted May 31, 2021 Author Share Posted May 31, 2021 (edited) I figured it out. First I grab the hash from tbladmins table based on correct selection of username, then do the following which gives me true or false. password_verify() is a buit in php function: https://www.php.net/manual/en/function.password-verify.php if (password_verify($password, $hash)) Edited May 31, 2021 by craigedmonds 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.