public function authenticate()
    {
        $this->_authenticateSetup();
        $dqlQuery = $this->_authenticateCreateSelect();
        $resultIdentities = $this->_authenticateQueryDql($dqlQuery);

        if (($authResult = $this->_authenticateValidateResultset($resultIdentities)) instanceof \Zend_Auth_Result) {
            return $authResult;
        }

        if (true === $this->getAmbiguityIdentity()) {
            $validIdentities = array();
            foreach ($resultIdentities as $identity) {
                if (1 === (int) $identity['zend_auth_credential_match']) {
                    $validIdentities[] = $identity;
                }
            }
            $resultIdentities = $validIdentities;
        }

        $authResult = $this->_authenticateValidateResult(array_shift($resultIdentities));
        return $authResult;
    }