public function authenticate() { $sso = new Pandamp_Session_Remote(); $authResult = $sso->authenticate($this->_identity, $this->_credential); $auth = Zend_Auth::getInstance(); if ($authResult->isValid()) { $data = $sso->getResultRowObject(); $auth->getStorage()->write($data); return $authResult; } else { if ($authResult->getCode() != -51) { Zend_Auth::getInstance()->clearIdentity(); } return $authResult; } }