尝试使用新的 Eve ESI 界面,但在尝试进行身份验证时收到以下错误响应:
HTTP/1.1 401 Unauthorized
Cache-Control: private
Server: Microsoft-IIS/8.5
Request-Context: appId=cid-v1:2ccf88f2-29b9-460a-bc15-7c0b79926f61
Date: Tue, 01 May 2018 00:24:50 GMT
Connection: close
Content-Length: 0
这是我的代码,使用 PHP/Curl:
<?php
$authcode = base64_encode("{my client ID}:{My Secret Key}");
$data = array("grant_type" => "authorization_code", "code" => "{code returned by the server}");
$data_string = json_encode($data);
$ch = curl_init("https://login.eveonline.com/oauth/token");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, array("Content-Type:application/json", "Authorization: Basic " . $authcode));
$result = curl_exec($ch);
print_r($result);
curl_close($ch);
?>
任何想法我做错了什么?我一直在尽可能地关注用户指南。
谢谢。