• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/classes/general/rest.php
  • Класс: CRestServer
  • Вызов: CRestServer::checkAuth
protected function checkAuth()
{
	$res = array();
	if(CRestUtil::checkAuth($this->query, $this->scope, $res))
	{
		$this->authType = $res['auth_type'];

		$this->clientId = isset($res['client_id']) ? $res['client_id'] : null;
		$this->passwordId = isset($res['password_id']) ? $res['password_id'] : null;

		$this->authData  = $res;

		if(
			(isset($this->authData['auth_connector']))
			&& !$this->canUseConnectors()
		)
		{
			throw new BitrixRestLicenseException('auth_connector');
		}

		if(isset($res['parameters_clear']) && is_array($res['parameters_clear']))
		{
			foreach($res['parameters_clear'] as $param)
			{
				if(array_key_exists($param, $this->query))
				{
					$this->auth[$param] = $this->query[$param];
					unset($this->query[$param]);
				}
			}
		}

		$arAdditionalParams = $res['parameters'] ?? null;
		if(isset($arAdditionalParams[BitrixRestEventSession::PARAM_SESSION]))
		{
			BitrixRestEventSession::set($arAdditionalParams[BitrixRestEventSession::PARAM_SESSION]);
		}

		return true;
	}
	else
	{
		throw new BitrixRestOAuthException($res);
	}
}