We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8425
    • 159 Posts
    Hello,
    1) I'm using MODx Rev 2.1.5. I need to be able to retrieve users' password in plain text as I'm doing users synchronization with another app. How can I do that in Modx?
    I know how to retrieve the salt and password (see below) but how should I go about getting the password in plain text
         $password = $modx->user->get('password');
         $salt = $modx->user->get('salt');


    2) I cannot set a password_hash value in MODx.

    - The api $modx->user->set('password', "clear-text-password"); expect a clear-text password and then encrypt it with the salt value. The password value I get from the third-application (Foxy-cart) is already encrypted therefore useless.

    By the way $modx->user->get('hash'); returns nothing...

    What would it take to add an api in MODx to be able to set password_hash value?

    Thank you
    [ed. note: eclipseTalk last edited this post 12 years, 2 months ago.]
    • You can't. The password is stored as a salted MD5 hash; this is a one-way hashing algorithm and cannot be reversed. The other application will have to hash its password and compare the hashes.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org