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.
 

Authorization - I always get information about the same character.

Author
Vex Munda
Anti Enslavement Movement
#1 - 2016-11-15 13:36:21 UTC
Hey,

Good news is that I finally managed to get the first bit of data pulled from eve's server!!

But there is a new problem; In the EVE-online confirmation page the user gives me permission to access their data. On that page they select a character from which I can get the information. But when I finish the authorization process and request the data I always get information about the same character. this character is the first one in the dropdown list. I would like to be able to access the one they selected. Is this a bug or should I set somekind of scope or something like that?

My code:

function charInfoRequest(){
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange=function() {
    if (this.readyState == 4 && this.status == 200) {    
        
    }
  }
  xhttp.open("GET", "https://login.eveonline.com/oauth/verify", true);
  xhttp.setRequestHeader("Authorization", "Bearer " + access_token);
  xhttp.send();
}


Bonus question: Anywhere I can easily get 128*128 images from NPC's? I want a dummy image to hold the portraits space. It would be okay if it isn't hosted by eve, because it's perfectly fine to host this image from my own server.
David Davaham
Deep Blue Logistics
#2 - 2016-11-15 16:23:55 UTC
So the Access Token is character specific. Not Account Specific. You may have noticed this when you sign in with the SSO. There is no way to get the characters that are on the account from CREST, but that can be done from the XML API.

Developer of EVEmail

Vex Munda
Anti Enslavement Movement
#3 - 2016-11-15 21:16:22 UTC
Ok. I figured out what I was doing wrong. During testing I navigated to the previous page, where I did the SSO on the EVE site. Apparently this defaults back to the results from the first time I used that specific page. Even after selecting another character.

It works if I start the SSO by opening my initial webpage from notepad++. (and thus repeat the entire SSO process). So, the issue is solved!