0

I want migrate a Magento2 to Woocommerce, but I see that these 2 cms uses a different login system.

If I would create a plugin/hook on wordpress for allow the login with the password that the customers used on Magento, what library I must import on Wordpress from Magento?

Otherwise, there is a system that convert the password from Magento to a system recognized by Wordpress?

2 Answers 2

0

Magento user passwords are stored using MD5 Cipher and is stored under

SELECT email, password_hash FROM customer_entity;

Unless Wordpress also uses MD5 cipher you will need to decifer the passwords hash and cipher it back into the wordpress password cipher.

To the best of my knowledge the isn't a library that would do this out of the box.

Documentation reference on how to get your cipher key:

https://docs.magento.com/user-guide/system/encryption-key.html

1
  • By default, Magento uses sha256
    – Infocurci
    May 6, 2022 at 8:20
0

I found this solution to login with a Magento password.

I will use this snippet to create a hook for wordpress.

 $currentPassword = 'password, extracted from db - table customer_entity';

$magento_pwd_parts = explode(':', $currentPassword);
$hash = $magento_pwd_parts['0'];
$salt = $magento_pwd_parts['1'];

if($hash === hash( 'sha256', $salt.'password sent from browser for login' ))
{
    echo 'logged!';
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.