Skip to content

Commit

Permalink
Merge pull request #419 from rruchte/auth-ambiguous-identity-fix
Browse files Browse the repository at this point in the history
Add check in DbTable Authentication Adapter for empty results when AmbiguityIdentity is TRUE
  • Loading branch information
develart-projects authored Jul 22, 2024
2 parents be808f8 + f9bc749 commit 5ca64ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/Zend/Auth/Adapter/DbTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,12 @@ protected function _authenticateValidateResultSet(array $resultIdentities)
protected function _authenticateValidateResult($resultIdentity)
{
$zendAuthCredentialMatchColumn = $this->_zendDb->foldCase('zend_auth_credential_match');

if ($resultIdentity[$zendAuthCredentialMatchColumn] != '1') {

if (empty($resultIdentity)) {
$this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;
$this->_authenticateResultInfo['messages'][] = 'A record with the supplied identity could not be found.';
return $this->_authenticateCreateAuthResult();
} elseif ($resultIdentity[$zendAuthCredentialMatchColumn] != '1') {
$this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
$this->_authenticateResultInfo['messages'][] = 'Supplied credential is invalid.';
return $this->_authenticateCreateAuthResult();
Expand Down

0 comments on commit 5ca64ea

Please sign in to comment.