My Try
Custom Controller To Print Password Hash:
for testing I alter protected method to public, createPasswordHash in Magento\Customer\Model\AccountManagement
<?php
namespace Vendor\Helloworld\Controller\Index;
class Index extends \Magento\Framework\App\Action\Action
{
protected $resultPageFactory;
protected $_account;
/**
* Constructor
*
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
\Magento\Customer\Model\AccountManagement $account
) {
$this->resultPageFactory = $resultPageFactory;
$this->_account=$account;
parent::__construct($context);
}
/**
* Execute view action
*
* @return \Magento\Framework\Controller\ResultInterface
*/
public function execute()
{
$password="qwer@123";
echo $this->_account->createPasswordHash($password);
// return $this->resultPageFactory->create();
}
}
it produce
11461f169755245382777f2cf8fcd344933851f302ad3fe4c225bb77f0988b37:BjBTkXlth0bU3rsLKGqqVRgIdo2sYULI:1
when I update newly generated database hash value, it allow to login by password qwer@123.
References: link1, link2
If anyone have better answer, please post your answer.