Issues

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

Issue Type: Bug Created: 2009-08-10T03:39:59.000+0000 Last Updated: 2009-09-08T20:35:49.000+0000 Status: Resolved Fix version(s): - 1.9.3 (22/Sep/09)

Reporter: Ondrej Sibrina (elsecz) Assignee: Ralph Schindler (ralph) Tags: - Zend_Auth

Related issues: Attachments:

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.

<pre class="highlight">
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.

<pre class="highlight">
 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:

<pre class="highlight">
$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()."<br></br>";  // print "ondra@mojestopa.cz"
echo $result->getIdentity()."<br></br>"; // 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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts