• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/liveid.php
  • Класс: WindowsLiveLogin
  • Вызов: WindowsLiveLogin::processToken
function processToken($token, $context=null)
{
	if (!$token) {
		$this->debug('Error: processToken: Invalid token specified.');
		return;
	}

	$decodedToken = $this->decodeAndValidateToken($token);
	if (!$decodedToken) {
		$this->debug("Error: processToken: Failed to decode/validate token: $token");
		return;
	}

	$parsedToken = $this->parse($decodedToken);
	if (!$parsedToken) {
		$this->debug("Error: processToken: Failed to parse token after decoding: $token");
		return;
	}

	$appid = $this->getAppId();
	$tokenappid = @$parsedToken['appid'];
	if ($appid != $tokenappid) {
		$this->debug("Error: processToken: Application ID in token did not match ours: $tokenappid, $appid");
		return;
	}

	$user = null;

	//try {
	$user = new WLL_User(@$parsedToken['ts'],
		@$parsedToken['uid'],
		@$parsedToken['flags'],
		$context, $token);
	//} catch (Exception $e) {
	if ($user->getError() !== false)
		$this->debug("Error: processToken: Contents of token considered invalid: " + $user->getError());
	//}

	return $user;
}