• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/liveid.php
  • Класс: WindowsLiveLogin
  • Вызов: WindowsLiveLogin::getAppSecurityToken
function getAppSecurityToken($siteid=null, $ip=null)
{
	$body = $this->fetch($this->getAppLoginUrl($siteid, $ip));
	if (!$body) {
		$this->debug("Error: getAppSecurityToken: Could not fetch the application security token.");
		return;
	}

	preg_match('/{"token":"(.*)"}/', $body, $matches);
	if(count($matches) == 2) {
		return $matches[1];
	}
	else {
		$this->debug("Error: getAppSecurityToken: Failed to extract token: $body");
		return;
	}
}