/** * Authenticates the user. * * Derived classes can override this method to customize authentication logic or impose * extra requirements on the user trying to login. * * @param AuthInterface $auth The Auth implementation to use when authenticating. * @return AuthResult */ protected function doAuthenticateSession(AuthInterface $auth) { Piwik::postEvent('Login.authenticate', array($auth->getLogin())); return $auth->authenticate(); }
/** * Authenticates the user. * * Derived classes can override this method to customize authentication logic or impose * extra requirements on the user trying to login. * * @param AuthInterface $auth The Auth implementation to use when authenticating. * @return AuthResult */ protected function doAuthenticateSession(AuthInterface $auth) { $login = $auth->getLogin(); $tokenAuthSecret = null; try { $tokenAuthSecret = $auth->getTokenAuthSecret(); } catch (Exception $ex) { Log::debug("SessionInitializer::doAuthenticateSession: token_auth secret for %s not available before user" . " is authenticated.", $login); } $tokenAuth = empty($tokenAuthSecret) ? null : $this->usersManagerAPI->getTokenAuth($login, $tokenAuthSecret); /** * @deprecated Create a custom SessionInitializer instead. */ Piwik::postEvent('Login.authenticate', array($auth->getLogin(), $tokenAuth)); return $auth->authenticate(); }