# Toying with ESI and C#

**URL:** <https://forums.eveonline.com/t/toying-with-esi-and-c/129715>\
**Category:** Third Party Developers\
**Created:** [December 27, 2018, 12:51am UTC](https://forums.eveonline.com/t/toying-with-esi-and-c/129715 "2018-12-27T00:51:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danelle\_Martos](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/danelle_martos/32/105286_2.png) [@Danelle\_Martos](https://forums.eveonline.com/u/Danelle_Martos)\
**Post date:** [December 27, 2018, 12:51am UTC](https://forums.eveonline.com/t/toying-with-esi-and-c/129715/1 "2018-12-27T00:51:51Z")

</div>

Hi everyone. Just to preface: I may have some stupid questions or glaring obvious answers I cannot see due to RL issues.

I’m messing around with C# as usual and decided to see what I could play with in the ESI data and stuff.

My aim is to first get authorized/logged in, then as a first example, get a character ID or something simple like that just to get me started and with an idea of how to start requesting information.

I’m stuck on the very first part already!

> ```
> string CallBackURL = "eveauth-app://callback/";
> string ClientID = " ****";
> string SecretKey = " ****";
> ESI myESI = new ESI(CallBackURL, ClientID, SecretKey);
> 
> ```

which is calling this:

> public ESI(string callBackURL, string clientID, string secretKey)  
> {  
> BuildScopes();  
> CallBackURL = “eveauth-app://callback/”;  
> ClientID = clientID;  
> SecretKey = secretKey;  
> Scope = Scopes[0];  
> }

BuildScopes() is reading a text file with _all_ the scopes from the dev page.

A successful URL is built 🙂

> string URL  
> {  
> get  
> {  
> return @“[https://login.eveonline.com/oauth/authorize/?response\_type=code&redirect\_uri=](https://login.eveonline.com/oauth/authorize/?response_type=code&redirect_uri=)” + CallBackURL + “&client\_id=” + ClientID + “&scope=” + Scope;  
> }  
> }

(Side note, how to request multiple scopes? Other apps I use have several items on the auth page).

The built URL _is_ successful is I copy and paste into a browser, correct character etc. I just can’t figure out what to do next!

---

<div class="post-metadata">

**Author:** ![Raph\_Mendoza](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/raph_mendoza/32/242641_2.png) [@Raph\_Mendoza](https://forums.eveonline.com/u/Raph_Mendoza)\
**Post date:** [December 28, 2018, 3:59am UTC](https://forums.eveonline.com/t/toying-with-esi-and-c/129715/2 "2018-12-28T03:59:31Z")

</div>

Hello. After you press authorize, the web browser should redirect and url would look like

> https://\<your-callback-url\>/?code=\<super-secret-code\>&state=\<unique-state-string-from-you\>

You would then use the value in the code parameter to get the tokens. For more details, take a look at the documention in

> [https://github.com/ccpgames/eveonline-third-party-documentation/blob/master/docs/sso/authentication.md](https://github.com/ccpgames/eveonline-third-party-documentation/blob/master/docs/sso/authentication.md)

To request for multiple scopes, I use

> string.Join(“%20”, scopeListToAuthenticate)

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [December 29, 2018, 12:06pm UTC](https://forums.eveonline.com/t/toying-with-esi-and-c/129715/3 "2018-12-29T12:06:38Z")

</div>

[https://github.com/esi/esi-docs/tree/master/docs/sso](https://github.com/esi/esi-docs/tree/master/docs/sso) Would be the updated SSO docs.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [March 29, 2019, 12:06pm UTC](https://forums.eveonline.com/t/toying-with-esi-and-c/129715/4 "2019-03-29T12:06:41Z")

</div>

Closed on March 29, 2019, 12:06pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
