EVE Technology Lab

 
 

ESI API Authentication

Author
#1 - 2017-05-19 14:56:40 UTC
I am trying my hands to the ESI api.

When I am trying to get basic information about players Stations
https://esi.tech.ccp.is/latest/universe/structures/1024235980117/?datasource=tranquility


I get requested with authentication.

As far as I can see, the data returned by this call is nothing critical (name, location,...), so what's the point of the authentication?

I have registered my application with EVE Developers so now I have a client ID and secret key.
How do I use them from C#?

So far this is what I am doing:


string link = "https://esi.tech.ccp.is/latest/markets/10000032/orders/?datasource=tranquility&order_type=all&page=1&type_id=2329";
HttpWebRequest apiRequest;
apiRequest = (HttpWebRequest)WebRequest.Create(link);

apiRequest.Credentials = null;
apiRequest.UseDefaultCredentials = false;
apiRequest.UserAgent = "EVE Planetary Planner";

apiRequest.UserAgent = @"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4";
using (HttpWebResponse apiResponse = (HttpWebResponse)apiRequest.GetResponse())
{
    Stream dataStream = apiResponse.GetResponseStream();
    StreamReader reader = new StreamReader(dataStream);
    string strResponse = reader.ReadToEnd();
    // do things here
}


Can someone show me an example of how to use the EVE Developers credentials? or point me to a tutorial?

Thanks
#2 - 2017-05-19 14:58:12 UTC
Also, what is the use of the callback URL?
How does it work with a C# application?
This was not clear when I registered my application, so I just put 'eveauth-app://callback/' to have something there...
#3 - 2017-05-19 22:48:50 UTC
Ideki wrote:
As far as I can see, the data returned by this call is nothing critical (name, location,...), so what's the point of the authentication?

It requires authorization because it will only work on structures that you have access to, ie are on the ACL.

Ideki wrote:
I have registered my application with EVE Developers so now I have a client ID and secret key.
How do I use them from C#?

Reference this thread for some info on C#:
https://forums.eveonline.com/default.aspx?g=posts&t=516279&find=unread

Also this for the general way to go about doing it:
http://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/authentication.html


Ideki wrote:
Also, what is the use of the callback URL?


After authentication the user will be redirected to this URL on your website. It must match the definition on file in the developers site.

Reference: http://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/authentication.html#redirect-to-the-sso

Ideki wrote:
How does it work with a C# application?


I have no idea. Have to have someone with C# exp help you there or figure it out yourself.
#4 - 2017-05-20 00:53:53 UTC
Blacksmoke16 wrote:
Ideki wrote:
As far as I can see, the data returned by this call is nothing critical (name, location,...), so what's the point of the authentication?

It requires authorization because it will only work on structures that you have access to, ie are on the ACL.

Ideki wrote:
I have registered my application with EVE Developers so now I have a client ID and secret key.
How do I use them from C#?

Reference this thread for some info on C#:
https://forums.eveonline.com/default.aspx?g=posts&t=516279&find=unread

Also this for the general way to go about doing it:
http://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/authentication.html


Ideki wrote:
Also, what is the use of the callback URL?


After authentication the user will be redirected to this URL on your website. It must match the definition on file in the developers site.

Reference: http://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/authentication.html#redirect-to-the-sso

Ideki wrote:
How does it work with a C# application?


I have no idea. Have to have someone with C# exp help you there or figure it out yourself.


Thanks a lot for the links, I will read them asap Big smile
Forum Jump