These forums have been archived and are now read-only.
The new forums are live and can be found at https://forums.eveonline.com/
CREST Response with http_code 400 | invalide_request
public function retrieveRefreshToken() { if ($this->getLoginState() != 3) { throw new Exception('Trying to Retrieve a Refreshment Token with a wrong Login state'); return null; } $header = 'Authorization: Basic ' . $this->cfg->getBase64AuthString(); // { return base64_encode($this->m_clientId . ':' . $this->m_secretKey); } $fields_string = ''; $fields = array( 'grant_type' => 'authorization_code', 'code' => $_GET['code'], ); foreach ($fields as $key => $value) { $fields_string .= $key . '=' . $value . '&'; } rtrim($fields_string, '&'); $ch = curl_init(); curl_setopt_array( $ch, array( CURLOPT_URL => $this->cfg->getCrestTokenUrl(), CURLOPT_POST => true, CURLOPT_POSTFIELDS => $fields_string, CURLOPT_HTTPHEADER => array($header), CURLOPT_RETURNTRANSFER => true, CURLOPT_USERAGENT => $this->cfg->getUserAgent(), CURLOPT_SSL_VERIFYPEER => true, CURLOPT_SSL_CIPHER_LIST => 'TLSv1', //prevent protocol negotiation fail ) ); $rPage = new CrestRequestPage(); $rPage->errorNumber = curl_errno($ch); $rPage->errorMsg = curl_error($ch); $rPage->contentJsonDecoded = json_decode(curl_exec($ch)); $rPage->content = curl_exec($ch); $rPage->header = curl_getinfo($ch); curl_close($ch); if ($rPage->errorNumber != 0) throw new Exception($rPage->errorMsg, $rPage->errorNumber); if (!in_array($rPage->header['http_code'], array(200, 302))) throw new Exception( 'HTTP response not OK: ' . (int) $rPage->header['http_code'] . '. Response body: ' . $rPage->content, $rPage->header['http_code'] ); $_SESSION['refreshToken'] = $rPage->contentJsonDecoded->refresh_token; }
[content] => {"error":"invalid_request","error_description":"Authorization code not found"}
@CCP_FoxFour // Technical Designer // Team Tech Co
Third-party developer? Check out the official developers site for dev blogs, resources, and more.
$rPage->contentJsonDecoded = json_decode(curl_exec($ch)); $rPage->content = curl_exec($ch);
$rPage->content = curl_exec($ch); $rPage->contentJsonDecoded = json_decode($rPage->content);