64 \
Magento\Framework\Event\ManagerInterface $eventManager,
65 \
Magento\Backend\Helper\Data $backendData,
66 \
Magento\Backend\Model\
Auth\StorageInterface $authStorage,
67 \
Magento\Backend\Model\
Auth\Credential\StorageInterface $credentialStorage,
68 \
Magento\Framework\
App\Config\ScopeConfigInterface $coreConfig,
69 \
Magento\Framework\Data\Collection\ModelFactory $modelFactory
71 $this->_eventManager = $eventManager;
72 $this->_backendData = $backendData;
73 $this->_authStorage = $authStorage;
74 $this->_credentialStorage = $credentialStorage;
75 $this->_coreConfig = $coreConfig;
76 $this->_modelFactory = $modelFactory;
88 if (!$storage instanceof \
Magento\Backend\Model\
Auth\StorageInterface) {
91 $this->_authStorage = $storage;
125 $this->_credentialStorage = $this->_modelFactory->create(
126 \
Magento\Backend\Model\
Auth\Credential\StorageInterface::class
149 public function login($username, $password)
151 if (empty($username) || empty($password)) {
154 'The account sign-in was incorrect or your account is disabled temporarily. ' 155 .
'Please wait and try again later.' 167 $this->_eventManager->dispatch(
168 'backend_auth_user_login_success',
176 'The account sign-in was incorrect or your account is disabled temporarily. ' 177 .
'Please wait and try again later.' 181 }
catch (PluginAuthenticationException $e) {
182 $this->_eventManager->dispatch(
183 'backend_auth_user_login_failed',
184 [
'user_name' => $username,
'exception' => $e]
187 }
catch (\
Magento\Framework\Exception\LocalizedException $e) {
188 $this->_eventManager->dispatch(
189 'backend_auth_user_login_failed',
190 [
'user_name' => $username,
'exception' => $e]
194 $e->getMessage()? :
'The account sign-in was incorrect or your account is disabled temporarily. ' 195 .
'Please wait and try again later.' 232 $msg =
__(
'An authentication error occurred. Verify and try again.');
static throwException(Phrase $msg=null)
__construct(\Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Backend\Helper\Data $backendData, \Magento\Backend\Model\Auth\StorageInterface $authStorage, \Magento\Backend\Model\Auth\Credential\StorageInterface $credentialStorage, \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Framework\Data\Collection\ModelFactory $modelFactory)
login($username, $password)