Jump to content

How to verify admin logins outside WHMCS using POST and php


Recommended Posts

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
 

Link to comment
Share on other sites

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 by craigedmonds
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated