These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

[SOLVED] SSO - Obtaining Character ID - Internal Server error (PHP)

Author
Ludizone
Carpe Diem Respice Finem
#1 - 2016-09-20 20:39:58 UTC  |  Edited by: Ludizone
Hello,

I'm trying to get CharacterID & CharacterName from players who loged on our corp website via CREST.

I managed to get the access_token & refresh_token (and store them in a Database), but I stick here.

I try to get these informations as described here : http://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/obtaincharacterid.html

My code (using PHP) is :

    $url = "https://login.eveonline.com/oauth/verify";
    $header = 'Authorization: Bearer '.$access_key; // access key i got before without any trouble
    
    $ch = curl_init();
    curl_setopt_array($ch, array(   
        CURLOPT_URL => $url,
        CURLOPT_HEADER => $header,
        CURLOPT_RETURNTRANSFER => true
    ));

    $output = curl_exec($ch);
    $info = curl_getinfo($ch);


The only output is an Internal Server error (500), Any idea of what i'm doing wrong ?

NB : I have very low knowledge in programming...
Blacksmoke16
Imperial Academy
#2 - 2016-09-20 21:01:08 UTC  |  Edited by: Blacksmoke16
Try changing

 $header = 'Authorization: Bearer '.$access_key;


and

    curl_setopt_array($ch, array(   
        CURLOPT_URL => $url,
        CURLOPT_HTTPHEADER => $header
    ));


to

$header = array('Authorization: Bearer '.$access_key, 'Content-Type: application/json');


    curl_setopt_array($ch, array(   
        CURLOPT_URL => $url,
        CURLOPT_HTTPHEADER => $header
    ));
Ludizone
Carpe Diem Respice Finem
#3 - 2016-09-21 05:45:44 UTC
All right it works well like that, thanks for your help !