Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Apr 2008
    Posts
    8

    Default XML API verify user's password?

    Hi there, just a quick one.
    Is there any API call I can use in which I pass an account's username and password and find out if it's valid or not? I'm writing a secondary "portal" for my customers, and to save them having 2 separate username & passwords, if I can use their cPanel user/password to let them login to both. This way also, if they change their password, they don't have to change their portal password as a second task, but it's already done for them.

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by danneh3826 View Post
    Hi there, just a quick one.
    Is there any API call I can use in which I pass an account's username and password and find out if it's valid or not? I'm writing a secondary "portal" for my customers, and to save them having 2 separate username & passwords, if I can use their cPanel user/password to let them login to both. This way also, if they change their password, they don't have to change their portal password as a second task, but it's already done for them.
    I am not aware of an API call that is specifically designed to verify a user's password. I can think of some work-arounds that involve creative uses of Passwd::change_password (as it requires the correct current password or it fails) or POP3 authentication against the default mail account. The latter is not a particularly good solution because in the event of too many failed logins, cphulkd may silently stop accepting logins and that wouldn't be a good thing.

    Another (more robust) solution you may wish to consider is password synchronization. In /usr/cpanel/hooks there's a README file that describes how to hook onto the event when a cPanel password is changed. You can use this to update the password stored with your portal. If your portal has a similar hook, you can use Passwd::change_password to update the cPanel password accordingly as well.

  3. #3
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,597

    Default

    You can just verify them against the shadow file on the server.
    -Nick
    cPanel Inc.

    Need support? Submit a request here. Complimentary support is available to all license holders regardless of where you purchased your license.
    Need a complimentary support account? Create one here.

Similar Threads & Tags
Similar threads

  1. Changing account password using PHP and XML-API
    By larwilliams in forum cPanel Developers
    Replies: 0
    Last Post: 11-30-2010, 06:15 PM
  2. Changing email password using XML api
    By bwor in forum cPanel Developers
    Replies: 1
    Last Post: 10-21-2010, 09:25 PM
  3. Improve performance of password change via XML-API
    By larwilliams in forum cPanel Developers
    Replies: 1
    Last Post: 01-25-2010, 10:22 AM
  4. Request XML-API function: change password
    By XenomediaBV in forum cPanel Developers
    Replies: 2
    Last Post: 09-14-2009, 01:41 PM
  5. XML-API, e-Mail, Password
    By beaver86 in forum cPanel Developers
    Replies: 3
    Last Post: 06-30-2009, 04:56 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube