- Модуль: socialservices
- Путь к файлу: ~/bitrix/modules/socialservices/classes/general/openidclient.php
- Класс: COpenIDClient
- Вызов: COpenIDClient::Validate
public function Validate()
{
if(CSocServAuthManager::CheckUniqueKey())
{
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';
if(isset($_SESSION['BX_OPENID_RETURN_TO']))
{
$arParams['openid.return_to'] = $_SESSION['BX_OPENID_RETURN_TO'];
unset($_SESSION['BX_OPENID_RETURN_TO']);
}
$str = CHTTP::sPost($arOpenidServerTags['server'], $arParams, true);
if (preg_match('/is_valids*:s*/' . BX_UTF_PCRE_MODIFIER, $str))
{
return array(
'server' => $arOpenidServerTags['server'],
'identity' => $_GET['openid_identity']
);
}
else
{
$GLOBALS['APPLICATION']->ThrowException(GetMessage('OPENID_CLIENT_ERROR_AUTH'));
}
}
}
// self::CleanParam('ERROR');
$GLOBALS['APPLICATION']->ThrowException(GetMessage('OPENID_CLIENT_ERROR_AUTH'));
return false;
}