$url = 'http://oa.dnc.global/oauth/token.php'; $options = array( 'method' => 'POST', 'datas' => array( 'grant_type' => 'authorization_code', 'code' => $authcode, 'redirect_uri' => 'http://chemindeleau.com/callback_openid.php', 'client_id' => 'chemin_openid', 'client_secret' => '01fc458', ) ); $res = recuperer_url($url, $options); $page = json_decode($res['page'], true); $token = $page['access_token']; $id_token = $page['id_token'];