Kullanıcının giriş yapıp yapmadığını session a bakarak kontrol eder

@return bool|AuthenticationLoginObject
345860
public function match(){

            $session = $this->getSession();
            $key = static::USER_SESSION;
            if($session->has($key)){

                if($value = $session->get($key) instanceof AuthenticationLoginObject){
                    return $value;
                }
            }else{
                return false;
            }
        }
499024
public static function authenticate() {
		$credentials = array(
			'calendar_guid' => (int) get_input('guid'),
			'user_guid' => (int) get_input('u'),
			'token' => get_input('t'),
		);

		$pam = new ElggPAM(self::POLICY);
		$authenticated = $pam->authenticate($credentials);
		if (!$authenticated) {
			throw new LoginException($pam->getFailureMessage());
		} else {
			$user = get_entity($credentials['user_guid']);
			login($user);
		}
		return $authenticated;
	}
1172921
public function login()
    {
        $identity = $this->getIdentity();

        if ($identity->authenticate($this->newPassword)) {
            return $this->webUser->login($identity, 0);
        }

        return false;
    }
614185
public function authenticate() {
        /* Anti Injection de login */
        $login1 = Security\AntiInjection::antiSqlInjection1($this->getIdentity());
        $login2 = Security\AntiInjection::antiSqlInjection2($login1);
        $identity = Security\AntiInjection::antiSqlInjection3($login2);

        /* Anti Injection de senha */
        $senha1 = Security\AntiInjection::antiSqlInjection1($this->getCredential());
        $senha2 = Security\AntiInjection::antiSqlInjection2($senha1);
        $senha3 = Security\AntiInjection::antiSqlInjection3($senha2);

        /* Criptografa a senha */
        $crypt = new Security\Crypt();
        $credential = $crypt->encrypt($senha3);

        //Define os dados para processar o login
        $this->setIdentity($identity)->setCredential($credential);

        //Faz inner join dos dados do perfil no SELECT do Auth_Adapter
        $select = $this->getDbSelect();

        if (!empty($this->whereConditions)) {
            foreach ($this->whereConditions as $valueWhereConditions) {
                $select->where($valueWhereConditions);
            }
        }

        //Efetua o login
        $result = parent::authenticate();

        //Verifica se o login foi efetuado com sucesso
        if ($result->isValid()) {
            //Recupera o objeto do usuário, sem a senha
            $info = $this->getResultRowObject($this->returnColumns, $this->credentialColumn);

            $storage = new SessionStorage();
            $storage->write($info);

            if ($result->getCode()) {
                return new ResultValidation(ResultValidation::SUCCESS, ((array) $info));
            } else {
                return new ResultValidation(ResultValidation::FAILURE, null);
            }
        } else {
            return new ResultValidation(ResultValidation::FAILURE, null);
        }
    }
115564
public function authenticate()
    {

        $signer = new RequestSigner();
        $signer->setProvider('USF');
        $authenticator = new RequestAuthenticator($signer, $this->_timeout);

        $key = $authenticator->authenticate($this->_requestWrapper, $this->_keyLoader);

        if ($key) {
            $this->principal = "[HMAC]".$key->getId();
            $this->attributes = [];
            return true;
        }

        return false;

    }
642758
public function authenticate(): bool
    {
        if (isset($_GET['access_token'])) {
            $this->logger->warning('found access_token in query string, you should use a bearer token instead due security reasons https://tools.ietf.org/html/rfc6750#section-2.3', [
                'category' => get_class($this),
            ]);

            return $this->verifyToken($_GET['access_token']);
        }
        if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
            $header = $_SERVER['HTTP_AUTHORIZATION'];
            $parts = explode(' ', $header);

            if ('Bearer' === $parts[0]) {
                $this->logger->debug('found http bearer authorization header', [
                    'category' => get_class($this),
                ]);

                return $this->verifyToken($parts[1]);
            }
            $this->logger->debug('no bearer token provided', [
                    'category' => get_class($this),
                ]);

            return false;
        }

        $this->logger->debug('http authorization header contains no bearer string or invalid authentication string', [
                    'category' => get_class($this),
                ]);

        return false;
    }
1366444
public function authenticate()
	{
		if (!$this->checkError()) {
			return false;
		}

		try {
			$proxy = $this->getProxy();

			if (!empty($_GET['code'])) {
				// This was a callback request from a service, get the token
				$proxy->requestAccessToken($_GET['code']);
				$this->authenticated = true;
			} else if ($proxy->hasValidAccessToken()) {
				$this->authenticated = true;
			} else {
				/** @var $url Uri */
				$url = $proxy->getAuthorizationUri();
				Yii::$app->getResponse()->redirect($url->getAbsoluteUri())->send();
			}
		} catch (OAuthException $e) {
			throw new ErrorException($e->getMessage(), $e->getCode(), 1, $e->getFile(), $e->getLine(), $e);
		}

		return $this->getIsAuthenticated();
	}
977843
public function login()
    {
        if ($this->validate()) {
            return Podium::getInstance()->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
        }
        return false;
    }
1113382
private function getUserAuthClass()
    {
        if ($this instanceof UserBehaviorInterface) {
            $class = $this->userAuthClass();
            
            if (!$class) { // return false;
                return false;
            }
            
            if (!is_object($class)) {
                return Yii::createObject($class);
            }
    
            return $class;
        }
        
        return false;
    }
305557
public function isAuthenticated()
    {
        if ($this->isAuthenticated === null) {
            try {
                $this->authenticate();
            } catch (AuthenticationRequiredException $exception) {
            }
        }
        return $this->isAuthenticated;
    }
1328909
public function getUserSession() {
		if (isset($_SESSION['user_'.$this->usernameKey])) {
			$arrUser = array();
			foreach ($_SESSION as $strKey => $strValue)
				if (substr($strKey, 0, 4) == 'user_')
					$arrUser[substr($strKey, 4)] = $strValue;
			return $arrUser;
		}

		return false;
	}
1110029
public static function authenticate($auth_data)
    {
        $password = $auth_data['password'];
        $login = $auth_data['login'];
        $user = self::getUser($login);
        if (! $user) {
            return false;
        }
        if (! $user->isActive()) {
            return false;
        }
        return User_Credential::checkCredential($login, $password) ? $user : false;
//         return ($user->checkPassword($password)) ? $user : false;
    }
428395
public function authenticate()
    {
        $result = false;

        if (isset($_GET['code'])) {
            $params = array(
                'grant_type' => 'authorization_code',
                'code' => $_GET['code'],
                'client_id' => $this->clientId,
                'client_secret' => $this->clientSecret
            );

            $tokenInfo = $this->post('https://oauth.yandex.ru/token', $params);

            if (isset($tokenInfo['access_token'])) {
                $params = array(
                    'format' => 'json',
                    'oauth_token' => $tokenInfo['access_token']
                );

                $userInfo = $this->get('https://login.yandex.ru/info', $params);

                if (isset($userInfo['id'])) {
                    $this->userInfo = $userInfo;
                    $result = true;
                }
            }
        }

        return $result;
    }
721719
private function loggenIn()
    {
        if (!$this->has()) {
            if (!($this->authService instanceof UserAuthServiceInterface)) {
                // Not logged in
                return false;
            }

            // Now try to find only in cookies, if found prepare a bag
            if ($this->reAuth->isStored() && (!$this->has())) {
                $userBag = $this->reAuth->getUserBag();
            }

            // If session namespace is filled up and at the same time data stored in cookies
            if (($this->has() && $this->reAuth->isStored()) || $this->has()) {
                $data = $this->sessionBag->get(self::AUTH_NAMESPACE);

                $userBag = new UserBag();
                $userBag->setLogin($data['login'])
                        ->setPasswordHash($data['passwordHash']);
            }

            // If $userBag wasn't created so far, that means user isn't logged at all
            if (!isset($userBag)) {
                return false;
            }

            // Now let's invoke our defined match visitor
            $authResult = $this->authService->authenticate($userBag->getLogin(), $userBag->getPasswordHash(), false, false);

            if ($authResult == true) {
                // Remember success, in order not to query on each request
                $this->login($userBag->getLogin(), $userBag->getPasswordHash());
                return true;
            }

            return false;

        } else {
            return true;
        }
    }
2501
public function login()
    {
        $response = $this->request(self::METHOD_POST, '/user/login', [
            'appkey' => $this->parameters->getAuth('appkey'),
            'email' => $this->parameters->getAuth('email'),
            'password' => $this->parameters->getAuth('password'),
            'hash' => $this->parameters->getAuth('hash'),
        ]);

        if (isset($response['apikey'])) {
            $this->apikey = $response['apikey'];
        }

        return $response;
    }
508626
public function authenticate()
    {
        $request = $this->getRequest();
        $adapter = $this->getAuthenticationAdapter();
        $result  = $adapter->setRequest($request);

        if ($result instanceof ResponseInterface) {
            return $result;
        }

        $result = $this->getAuthenticationService()->authenticate($adapter);
        $messages = $result->getMessages();
        if (!$messages) {
            return $result;
        }

        $controller = $this->getController();
        /* @var $flash \Zend\Mvc\Controller\Plugin\FlashMessenger */
        $flash = $controller->flashMessenger();

        switch ($result->getCode()) {
            case Result::SUCCESS:
                foreach ($messages as $message) {
                    $flash->addSuccessMessage($controller->translate($message));
                }
                break;
            case Result::FAILURE_UNCATEGORIZED:
                foreach ($messages as $message) {
                    $flash->addErrorMessage($controller->translate($message));
                }
                break;
            case Result::FAILURE_IDENTITY_NOT_FOUND:
                $identityKey = $adapter->getEvent()->getIdentityKey();
                foreach ($messages as $message) {
                    $errors[$identityKey][] = $controller->translate($message);
                }
                $flash->addErrorMessage($errors);
                break;
            case Result::FAILURE_CREDENTIAL_INVALID:
                $credentialKey = $adapter->getEvent()->getCredentialKey();
                foreach ($messages as $message) {
                    $errors[$credentialKey][] = $controller->translate($message);
                }
                $flash->addErrorMessage($errors);
        }

        if (!$result->isValid()) {
            $adapter->resetAdapters();
        }

        return $result;
    }
564169
public static function CheckAuthentication(){
            $oThis = self::CreateInstanceIfNotExists();
            $bReturn = ($oThis->bStarted) ? (!empty($oThis->aAuth["id"]) && !empty($oThis->aAuth["username"]) && ((intval($oThis->aAuth["timeout"]) > time()) || (intval($oThis->aAuth["timeout"]) <= 0))) : false;
            return $bReturn;
        }