ZF-7546: Issue with multiple autentication, store only succes result


As you can see only good result is saved. If autentication is wrong, then result is ignored and it's not stored. But return is false. That's right.

public function authenticate(Zend_Auth_Adapter_Interface $adapter)
        $result = $adapter->authenticate();

        if ($result->isValid()) {

        return $result;

Real issue rise up with redirection Zend_Auth::getIdentity(). It returns succes result.

 public function getIdentity()
        $storage = $this->getStorage();

        if ($storage->isEmpty()) {
            return null;

        return $storage->read();

So there're two ways how to get result of autenticate but unfortunately it gives another result:

$this->_auth->authenticate(new My_Auth_Adapter_User("","******")); // success
$result = $this->_auth->authenticate(new My_Auth_Adapter_User("","wrong password")); //failure

echo $this->_auth->getIdentity()."
"; // print "" echo $result->getIdentity()."
"; // print ""

I hope you understand, what i'm talking about. I think it should gives defaultly failure in both ways.


Fixed in 18038 in trunk and 18039 in 1.9 branch