Thank you very much, I have to solve this problem.
But in the Exchange Authorization code by an Access Token.
I encountered a new problem,
my url is as follows:
http://192.168.1.215/workflow/oauth2/au ... Test02.php
my code is as follows:
Code: Select allif (! empty($_GET['error'])) {
print_r($_GET);
die();
}
echo $_GET['code'];
$url = "http://192.168.1.215/workflow/oauth2/token";
$postParams = array(
"grant_type"=>"authorization_code",
"code"=>$_GET['code'],
"redirect_uri"=>"http://192.168.2.67/PM3/OAuthTest02.php"
);
$postHeader = array(
"Authorization: Basic eC1wbS1sb2NhbC1jbGllbnQ6MTc5YWQ0NWM2Y2UyY2I5N2NmMTAyOWUyMTIwNDZlODE="
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $postHeader);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.2; rv:32.0) Gecko/20100101 Firefox/32.0');
$result = curl_exec($ch);
$data = json_decode($result, true);
var_dump($data);
curl_close($ch);
Returned as follows:
Code: Select allfbb19bd9aba817189c6b837246c682260a548080
array (size=2)
'error' => string 'invalid_grant' (length=13)
'error_description' => string 'authorization_code doesn't exist or is invalid for the client' (length=61)
In "
http://tools.ietf.org/html/rfc6749#section-3.2.1" I found a description for this error:
invalid_grant
The provided authorization grant (eg, authorization
code, resource owner credentials) or refresh token is
invalid, expired, revoked, does not match the redirection
URI used in the authorization request, or was issued to
another client.
But my code looks like no problem, I ask what is asked?