/** * setCredentialHashingStrategy * * Set the strategy used to hash and verify the users password. * * @param AuthenticationEvent $event The authentication event. * * @return void */ public function setCredentialHashingStrategy(AuthenticationEvent $event) { $adapter = $event->getAdapter(); if (!$adapter instanceof PasswordStrategyAwareInterface) { return; } $adapter->setPasswordStrategy($this->passwordStrategy); }
/** * prepareAdapterIdentity * * Inject the identity and credential values into the authentication adapter. * * @param AuthenticationEvent $event The authentication event. */ public function prepareValidatableAdapter(AuthenticationEvent $event) { $adapter = $event->getAdapter(); if (!$adapter instanceof ValidatableAdapterInterface) { return; } $identity = $event->getParam($this->identityFieldName, false); $credential = $event->getParam($this->credentialFieldName, false); if (!empty($identity) && is_string($identity)) { $adapter->setIdentity($identity); } if (!empty($credential) && is_string($credential)) { $adapter->setCredential($credential); } }