• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/openid.php
  • Класс: COpenIDClient
  • Вызов: COpenIDClient::Validate
function Validate()
{
	if ($arOpenidServerTags = $this->GetOpenIDServerTags($_GET['openid_identity']))
	{
		$arParams = array(
			'openid.assoc_handle' => $_GET['openid_assoc_handle'],
			'openid.signed' => $_GET['openid_signed'],
			'openid.sig' => $_GET['openid_sig'],
		);
		$arSigned = explode(',', $_GET['openid_signed']);
		foreach ($arSigned as $s)
			$arParams['openid.' . $s] = $_GET['openid_' . str_replace('.', '_', $s)];

		$arParams['openid.mode'] = 'check_authentication';

		$str = CHTTP::sPost($arOpenidServerTags['server'], $arParams, true);

		if (preg_match('/is_valids*:s*true/' . BX_UTF_PCRE_MODIFIER, $str))
		{
			return array(
					'server' => $arOpenidServerTags['server'],
					'identity' => $_GET['openid_identity']
				);
		}
		else
		{
			$GLOBALS['APPLICATION']->ThrowException(GetMessage('OPENID_CLIENT_ERROR_AUTH'));
		}
	}
	return false;
}