0
我沒有編碼多年,所以請原諒我。我試着用下面的代碼以獲得來自估計API令牌,但得到這個錯誤返回:無法從Reckon API獲取令牌 - 返回SSL錯誤
「SSL證書問題:無法獲取本地頒發者證書」
<?php
$code= $_GET['code'];
$url = 'https://identity.reckon.com/connect/token';
$auth_creds = "CLIENTID:CLIENTSECRET";
$headers = array(
"Content-Type: application/x-www-form-urlencoded",
"Authorization: Basic" . base64_encode($auth_creds));
$body = 'grant_type=authorization_code&code=' . $code .
'&redirect_uri=http://localhost';
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
$response = curl_exec($ch);
if($response === false)$response= curl_error($ch);
curl_close($ch);
echo $response;
?>
我遵循Reckon API oauth幫助文檔:https://reckon.helpdocsonline.com/reckon-api-authorisation-services
你是怎麼改變你的客戶端ID和密碼的編碼的。我得到相同的invalid_client錯誤 – Brett