PHP卷曲返回空白

嗨,我试图实施oauth协议,并已经maged获得授权代码,但是当请求令牌时,我做的卷曲请求返回空白。

继承人迄今为止的代码

<?php
$code=$_GET["code"];
//URL of targeted site  
$baseurl = "http://okowsc.co.uk/oauth/request_token?grant_type=authorization_code&client_id=CLIENTHERE&client_secret=80e294010d50bc71c04b&code=";
$url="$baseurl" . "$code";
print "$url";

 $curl = curl_init();
    curl_setopt ($curl, CURLOPT_URL, "http://okowsc.co.uk/oauth/request_token");
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

    $result = curl_exec ($curl);
    curl_close ($curl);
    print "$result";

//$returnValue = json_decode('{"access_token":"1e36f6fd77f2f667099ef8f9a0bd332ca4b97831","expires_in":3600,"token_type":"bearer","scope":"","refresh_token":"d23dca2981dd11669501a0a3d2a5d00ef0f51c75"}', true);
$returnValue = json_decode($output, true);
//print_r ($returnValue);
//echo $returnValue[key($returnValue)];
//echo $returnValue[key($returnValue)];
//echo $returnValue[key($returnValue)];
echo $returnValue[key($returnValue)];
?>

请求令牌页面在输入浏览器时起作用,它应该返回{“access_token”:“ ***** ”,“expires_in”:3600,“token_type”:“承载”,“scope”:“”,“refresh_token” :“ ******** ”}“(注意它是一个oauth标记)感谢任何答案

链接地址: http://www.djcxy.com/p/48029.html

上一篇: PHP curl returning blank

下一篇: OAuth v2 communication between authentication and resource server