meraproject/module/integration/yandex/service/passport.php

21 lines
524 B
PHP
Raw Permalink Normal View History

<?
namespace integration\yandex\service;
class Passport {
static function requestInfo($token = ''){
$res = null;
if ($curl = curl_init()){
curl_setopt($curl, CURLOPT_URL, 'https://login.yandex.ru/info?oauth_token='.$token);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);
$out = curl_exec($curl);
curl_close($curl);
$res = json_decode($out);
}
return $res;
}
}