# ESI and authorizations

**URL:** <https://forums.eveonline.com/t/esi-and-authorizations/48852>\
**Category:** Third Party Developers\
**Created:** [January 2, 2018, 7:17pm UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852 "2018-01-02T19:17:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maru\_Niffilen](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/maru_niffilen/32/47145_2.png) [@Maru\_Niffilen](https://forums.eveonline.com/u/Maru_Niffilen)\
**Post date:** [January 2, 2018, 7:17pm UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/1 "2018-01-02T19:17:17Z")

</div>

I’m trying building myself a React App. Currently there’s no server side stuff like Express or a DB on my agenda.

My goal is to use ESI. API calls without authorizations are no problem. However I’m struggling with stuff like asking for the current orders of a character.

I’m looking for a general guidance from Javascript/webdevs how I could tackle authorization.

Some questions:

- Do I need a database for the authentication?
- Would passport.js make my life easier?
- Is there any guide that could help me?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Rtg\_Quack](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/rtg_quack/32/259589_2.png) [@Rtg\_Quack](https://forums.eveonline.com/u/Rtg_Quack)\
**Post date:** [January 2, 2018, 8:56pm UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/2 "2018-01-02T20:56:52Z")

</div>

> [@Maru\_Niffilen](#):
>
> React

I’m not used to react but the idea is always the same, regardless of your programming language.

You may use the Eve Oauth authenfication. In this case you don’t need a user database except to manage different access levels.

To understand the concept you may read: [ESI Step by Step - SSO to Authenticated Calls - EVE: Developers](https://developers.eveonline.com/blog/article/sso-to-authenticated-calls)

Maybe you would like your favourite seach engine then for “oauth react”.

Cheers,  
Rtg Quack

---

<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:** [January 2, 2018, 9:51pm UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/3 "2018-01-02T21:51:30Z")

</div>

In order to make the auth worth while you need a way to store the refresh token to generate a new access token when they expire. Otherwise you will be using implicit auth, which means the user would have to log in every 20min to get a new token.

Whether this is a full fleged database like MySQL or PostgreSQL, or something like [http://lokijs.org/](http://lokijs.org/) is up to you.

I never used it so couldn’t say. ESI uses OAuth2 so could use anything that supports that.

The link @Rtg_Quack linked would be a good one.

EDIT: I also walk thru the Auth process here:

> **[r/evetech - Using API Key To Get Wallet Transactions](https://pr.reddit.com/r/evetech/comments/6w66y3/using_api_key_to_get_wallet_transactions/dm5soo7/?context=3)**
>
> 4 votes and 10 comments so far on Reddit

---

<div class="post-metadata">

**Author:** ![Maru\_Niffilen](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/maru_niffilen/32/47145_2.png) [@Maru\_Niffilen](https://forums.eveonline.com/u/Maru_Niffilen)\
**Post date:** [January 3, 2018, 6:24am UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/4 "2018-01-03T06:24:07Z")

</div>

Thanks a lot. I managed to get the corporation order list and grasp the concept now. At least the implicit way.

---

<div class="post-metadata">

**Author:** ![Maru\_Niffilen](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/maru_niffilen/32/47145_2.png) [@Maru\_Niffilen](https://forums.eveonline.com/u/Maru_Niffilen)\
**Post date:** [January 3, 2018, 5:36pm UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/5 "2018-01-03T17:36:58Z")

</div>

I understand that I can keep someone logged in with the refresh token. How is that working with an offline app like jEveAssets? I don’t have to log in after the next day.

---

<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:** [January 3, 2018, 5:49pm UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/6 "2018-01-03T17:49:04Z")

</div>

Well the refresh token doesn’t keep someone logged in per say in the sense of like logging into Facebook. It just allows you to log in once, and use the refresh\_token to generate new access\_tokens used for auth’d endpoints when/as they expire.

I can’t speak for how jEveAssets does it specifically, you would have to ask @Golden_Gnu.

---

<div class="post-metadata">

**Author:** ![Maru\_Niffilen](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/maru_niffilen/32/47145_2.png) [@Maru\_Niffilen](https://forums.eveonline.com/u/Maru_Niffilen)\
**Post date:** [January 3, 2018, 6:08pm UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/7 "2018-01-03T18:08:14Z")

</div>

Okay. But let’s say an app fetches character contracts every hour. Would it be totally viable to use refresh tokens all the time? Or is there another way to keep access for a longer period than 20 minutes?

---

<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:** [January 3, 2018, 6:36pm UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/8 "2018-01-03T18:36:16Z")

</div>

I think you are misunderstanding what a refresh\_token does/is.

See this for reference:  
[http://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/refreshtokens.html](http://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/refreshtokens.html)

PS: Cache timer for contracts is 5 minutes 😉

---

<div class="post-metadata">

**Author:** ![Maru\_Niffilen](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/maru_niffilen/32/47145_2.png) [@Maru\_Niffilen](https://forums.eveonline.com/u/Maru_Niffilen)\
**Post date:** [January 3, 2018, 7:24pm UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/9 "2018-01-03T19:24:53Z")

</div>

Got it! With the refresh\_token I can get a new access\_token which I need for ESI. The refresh\_token will only work as long as the player/account allows access to my Third Party Application.

---

<div class="post-metadata">

**Author:** ![Krysenth](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/krysenth/32/58194_2.png) [@Krysenth](https://forums.eveonline.com/u/Krysenth)\
**Post date:** [January 6, 2018, 7:00am UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/10 "2018-01-06T07:00:44Z")

</div>

> [@Maru\_Niffilen](#):
>
> I’m trying building myself a React App. Currently there’s no server side stuff like Express or a DB on my agenda.
> 
> My goal is to use ESI. API calls without authorizations are no problem. However I’m struggling with stuff like asking for the current orders of a character.
> 
> I’m looking for a general guidance from Javascript/webdevs how I could tackle authorization.
> 
> Some questions:
> 
> - Do I need a database for the authentication?
> - Would passport.js make my life easier?
> - Is there any guide that could help me?
> 
> Thanks in advance.

> **[Tweetfleet Slack Invites - Fuzzwork Enterprises](https://www.fuzzwork.co.uk/tweetfleet-slack-invites/)**
>
> Due to the terms of service of Slack, we can’t automate the creation of new accounts. So, to make things easy for everyone involved, I’ve put this page together. If you log in with your Eve account (top right), then return to this page, you’ll find a...

Feel free to request an invite to the slack server. The channels you’d want to hop into for quicker answers to questions would be the `#esi and #sso` channels (for api and authentication questions, respectively).

---

<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:** [April 6, 2018, 7:00am UTC](https://forums.eveonline.com/t/esi-and-authorizations/48852/11 "2018-04-06T07:00:58Z")

</div>

Closed on April 6, 2018, 7:00am UTC

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