| Current Path : /home/pressec/www/presselib/anjljson/ |
| Current File : /home/pressec/www/presselib/anjljson/auth_token_et0.php |
<?php
//connexion
// Demander un jeton d'accès pour l'application
$jeton = '';
$AuthCode ='MjdfYWpsNjRAcHJlc3NlbGliLmNvbTpoeDE0NXN1b2J6NzRpNjZndjBqb2psOXBseWk3b3lsYWtpaDVrc3oxcHNoY3o5NzYzZQ==';
$url = 'HTTPS://PORTAIL.ACTULEGALES.FR/OAUTH/V2/TOKEN';
$datas = array(
'grant_type' => 'authorization_code',
'code' => $AuthCode ,
'username' => 'ajl@presselib.com',
'password' => '64PLBAjl2020852',
'grant_type' => 'password',
'scope' => 'user',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $datas);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 3600);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result_json = curl_exec($ch);
$result = json_decode($result_json, true);
$token = $result['access_token'];
//reponse
$reponse = var_dump(http_response_code());
//curl_close($ch);
echo $reponse;
?>
<?php
?>