ZF-7546: Issue with multiple autentication, store only succes result
Description
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()) {
$this->getStorage()->write($result->getIdentity());
}
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("ondra@mojestopa.cz","******")); // success
$result = $this->_auth->authenticate(new My_Auth_Adapter_User("ondra@mojestopa.cz","wrong password")); //failure
echo $this->_auth->getIdentity()."
"; // print "ondra@mojestopa.cz"
echo $result->getIdentity()."
"; // print ""
I hope you understand, what i'm talking about. I think it should gives defaultly failure in both ways.
Comments
Posted by Ralph Schindler (ralph) on 2009-09-08T20:35:43.000+0000
Fixed in 18038 in trunk and 18039 in 1.9 branch