I have migrated data from Magento 1.4.1 to Magento 2.3.3 using Magento Data Migration tool. Data has migrated successfully but Magento 1 customer login not working in Magento 2.3.3. I know there is a password_hash issue. I already tried the command php -f bin/magento customer:hash:upgrade. and I also truncate the table "customer_entity_var" still no luck.
1 Answer
I suggest going to a file name encryptor.php in the vendor folder (Path is below) vendor\magento\framework\Encryption\Encryptor.php and change isValidHash() function like below.
public function isValidHash($password, $hash)
{
try {
$this->explodePasswordHash($hash);
foreach ($this->getPasswordVersion() as $hashVersion) {
if ($hashVersion == '0') {
$recreated = current(explode(':', $hash));
}else if ($hashVersion === self::HASH_VERSION_ARGON2ID13) {
$recreated = $this->getArgonHash($password, $this->getPasswordSalt());
} else {
$recreated = $this->generateSimpleHash($this->getPasswordSalt() . $password, $hashVersion);
}
$hash = $this->getPasswordHash();
error_log('password changing technique ======');
error_log(print_r($recreated,true));
error_log(print_r($hash,true));
}
} catch (\RuntimeException $exception) {
//Hash is not a password hash.
$recreated = $this->hash($password);
}
return Security::compareStrings(
$recreated,
$hash
);
}
And if you don't want to change the core code, you can also create a custom module.
Hope that help!