PHP curl returning blank
hi i am trying to implement the oauth protocol and have manged to get an authorization code,however when requesting a token the curl request i make returns blank.
heres the code i have so far
<?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)];
?>
the request token page works when entered into a browser it should return {"access_token":" ***** ","expires_in":3600,"token_type":"bearer","scope":"","refresh_token":" ******** "}" (stared out as its an oauth token) thanks for any answers
链接地址: http://www.djcxy.com/p/48030.html上一篇: 客户端的OAuth2响应
下一篇: PHP卷曲返回空白