# ESI authorization for apps and services with no browser access or UI

**URL:** <https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279>\
**Category:** Third Party Developers\
**Tags:** api, feature-request, esi\
**Created:** [March 6, 2022, 1:52pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279 "2022-03-06T13:52:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emotional\_Support\_Clown](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/emotional_support_clown/32/310422_2.png) [@Emotional\_Support\_Clown](https://forums.eveonline.com/u/Emotional_Support_Clown)\
**Post date:** [March 6, 2022, 1:52pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/1 "2022-03-06T13:52:29Z")

</div>

I see the ESI is using OAuth2 for authorization of the API. Since this uses a browser for SSO (as per best practices of OAuth2) and relies on form posting and redirects to obtain authorization tokens.

How can one authorize a client that has 1) no browser and 2) no UI with OAuth2 authorization flow?

Using a browser and UI is a no go for a service and command line app flow.

Can we obtain a long lived (and revokable) token with or without OAuth2 for such a headless scenario, or API key, and, will CCP be adopting IETF GNAP [1] that addresses such use cases?

[1] [draft-ietf-gnap-core-protocol-09 - Grant Negotiation and Authorization Protocol](https://datatracker.ietf.org/doc/draft-ietf-gnap-core-protocol/)

---

<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:** [March 6, 2022, 2:57pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/2 "2022-03-06T14:57:54Z")

</div>

> [@Emotional\_Support\_Clown](#):
>
> How can one authorize a client that has 1) no browser and 2) no UI with OAuth2 authorization flow?

You can’t. Current implementation requires them. At least for the first flow. Once you have the refresh token, the user won’t need the browser again for the most part. So your CLI flow or whatever could be used just fine. The refresh token would last for a month if unused, or until the user revokes the grant/changed their password.

> [@Emotional\_Support\_Clown](#):
>
> will CCP be adopting IETF GNAP [1] that addresses such use cases?

Probably not.

---

<div class="post-metadata">

**Author:** ![Emotional\_Support\_Clown](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/emotional_support_clown/32/310422_2.png) [@Emotional\_Support\_Clown](https://forums.eveonline.com/u/Emotional_Support_Clown)\
**Post date:** [March 6, 2022, 3:48pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/3 "2022-03-06T15:48:46Z")

</div>

The CLI flow will be on a headless device with no desktop environment, perhaps a Pi or a VM instance, also potentially scheduled.

It will be integrating with other applications in a pipeline. There will be no browser.

---

<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:** [March 6, 2022, 3:52pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/4 "2022-03-06T15:52:23Z")

</div>

Then your best bet would be to do the auth on another computer with a browser and copy the credentials to it. Such as to a database, file on disk, etc.

Also to be clear the server itself doesn’t need to have a browser or anything. That could be setup to handle the flow, but you could initiate the flow from another computer that does. As all the server needs to do is some HTTP requests, with a small lightweight web server to handle the routing and logic of what to do for each step.

---

<div class="post-metadata">

**Author:** ![Golden\_Gnu](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/golden_gnu/32/459734_2.png) [@Golden\_Gnu](https://forums.eveonline.com/u/Golden_Gnu)\
**Post date:** [March 7, 2022, 5:41pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/5 "2022-03-07T17:41:57Z")

</div>

In short: Create the refresh\_token(s) on a computer with a browser and move the refresh\_token(s) to your headless device. Expect nothing new (like this or anything else) to be added to ESI anytime soon…

---

<div class="post-metadata">

**Author:** ![Emotional\_Support\_Clown](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/emotional_support_clown/32/310422_2.png) [@Emotional\_Support\_Clown](https://forums.eveonline.com/u/Emotional_Support_Clown)\
**Post date:** [March 21, 2022, 7:45am UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/6 "2022-03-21T07:45:08Z")

</div>

So, basically write another app to generate and extract tokens for headless devices and apps. A more general app for provisioning.

---

<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:** [March 21, 2022, 1:06pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/7 "2022-03-21T13:06:49Z")

</div>

Again to be clear, the server itself can be headless and does not require a GUI or desktop environment as long as it is setup to handle the OAuth flow, which could be initiated from a computer that does. I.e. the one you’re using to reply to this thread.

If you do not want to server to have a webserver at all, then you would have to do the flow manually on your computer, via Postman or something, and copy the credentials over manually. However the server will need something to handle the refreshing of the token.

I’d checkout [SSO Authorization Flow | esi-docs](https://docs.esi.evetech.net/docs/sso/sso_authorization_flow.html) if you haven’t already.

---

<div class="post-metadata">

**Author:** ![Emotional\_Support\_Clown](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/emotional_support_clown/32/310422_2.png) [@Emotional\_Support\_Clown](https://forums.eveonline.com/u/Emotional_Support_Clown)\
**Post date:** [March 21, 2022, 1:19pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/8 "2022-03-21T13:19:40Z")

</div>

I was thinking more of an app that you put in the client ID and the private key and pull out and store refresh and access tokens then put them to the headless apps. Just a simple provisioning app for any clients and keys, that provisioning app will be user facing for authorizing when need be.

---

<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:** [March 21, 2022, 1:29pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/9 "2022-03-21T13:29:15Z")

</div>

Guess I’m just confused what the benefit of that would be over just doing everything in the headless app.

---

<div class="post-metadata">

**Author:** ![Emotional\_Support\_Clown](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/emotional_support_clown/32/310422_2.png) [@Emotional\_Support\_Clown](https://forums.eveonline.com/u/Emotional_Support_Clown)\
**Post date:** [March 21, 2022, 1:33pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/10 "2022-03-21T13:33:12Z")

</div>

The headless app won’t have a browser to get the user to sign in. The headless app will only work with a key it is provided with.

---

<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:** [March 21, 2022, 1:38pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/11 "2022-03-21T13:38:25Z")

</div>

> [@Blacksmoke16](#):
>
> Again to be clear, the server itself can be headless and does not require a GUI or desktop environment as long as it is setup to handle the OAuth flow, which could be initiated from a computer that does. I.e. the one you’re using to reply to this thread.

You can initiate the OAuth flow from any computer that has a browser, which does _NOT_ have to be on the same computer as the server. I’d checkout [SSO Authorization Flow | esi-docs](https://docs.esi.evetech.net/docs/sso/sso_authorization_flow.html) if you haven’t already as it walks thru the flow.

The gist of it is you do a GET request to a URL that includes a redirect URL, which would be your headless server. Once you login, it redirects to that URL, you exchange code for a token, save it, and redirect the other somewhere else if you want. There is no need for the headless server to have a browser or anything at all.

---

<div class="post-metadata">

**Author:** ![Emotional\_Support\_Clown](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/emotional_support_clown/32/310422_2.png) [@Emotional\_Support\_Clown](https://forums.eveonline.com/u/Emotional_Support_Clown)\
**Post date:** [March 21, 2022, 1:39pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/12 "2022-03-21T13:39:33Z")

</div>

Sure, I would rather break that out to a general provisioning app then copy that across to the headless app. One to manually manage authorization and obtaining valid tokens, and the headless app to do what it does and less bloating with simulating human sign on stuff it won’t need.

I simply hate OAuth2. A failure of design by committee and doesn’t work well with modern needs and is stuck in the year 2010’s.

---

<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:** [March 21, 2022, 1:42pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/13 "2022-03-21T13:42:01Z")

</div>

Still don’t see the reason to maintain two apps…but okay. The headless app doesn’t need to simulate anything as its just responding to HTTP requests, no human interaction required…

---

<div class="post-metadata">

**Author:** ![Emotional\_Support\_Clown](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/emotional_support_clown/32/310422_2.png) [@Emotional\_Support\_Clown](https://forums.eveonline.com/u/Emotional_Support_Clown)\
**Post date:** [March 21, 2022, 1:45pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/14 "2022-03-21T13:45:27Z")

</div>

> [@Blacksmoke16](#):
>
> no human interaction required…

Pretty sure every app I use requires a sign in periodically.

---

<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:** [March 21, 2022, 1:47pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/15 "2022-03-21T13:47:06Z")

</div>

Right, but you’re not doing that signon from the headless app/server itself. You can do it on _any_ browser, as long as that computer has access to the headless app/server. E.g. public over internet, or `localhost` so the OAuth flow can process the OAuth redirect.

---

<div class="post-metadata">

**Author:** ![Tonto\_Auri](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/tonto_auri/32/388339_2.png) [@Tonto\_Auri](https://forums.eveonline.com/u/Tonto_Auri)\
**Post date:** [March 25, 2022, 4:38pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/16 "2022-03-25T16:38:42Z")

</div>

Simple answer is that CCP killed standalone apps with SSO.

---

<div class="post-metadata">

**Author:** ![Emotional\_Support\_Clown](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/emotional_support_clown/32/310422_2.png) [@Emotional\_Support\_Clown](https://forums.eveonline.com/u/Emotional_Support_Clown)\
**Post date:** [March 25, 2022, 5:47pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/17 "2022-03-25T17:47:17Z")

</div>

[https://oauth.net/2/grant-types/device-code/](https://oauth.net/2/grant-types/device-code/)

This would do it perhaps.

---

<div class="post-metadata">

**Author:** ![Golden\_Gnu](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/golden_gnu/32/459734_2.png) [@Golden\_Gnu](https://forums.eveonline.com/u/Golden_Gnu)\
**Post date:** [March 25, 2022, 6:57pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/18 "2022-03-25T18:57:10Z")

</div>

I feel like technically the refresh\_token works pretty much like the legacy XmlAPI id/keys.  
Making a callback page that give you the authorization code or refresh token, is super simple.  
IMHO SSO only adds functionality, it may make things marginal harder, but, with the amount of ready to use libraries, it should be trivial.

---

<div class="post-metadata">

**Author:** ![Emotional\_Support\_Clown](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/emotional_support_clown/32/310422_2.png) [@Emotional\_Support\_Clown](https://forums.eveonline.com/u/Emotional_Support_Clown)\
**Post date:** [April 1, 2022, 3:19pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/19 "2022-04-01T15:19:01Z")

</div>

There is currently a ticket open for the OAuth2 device grant flow for ESI SSO.

> <https://github.com/ccpgames/sso-issues/issues/65>
>
> \# Feature / Modification Request
> 
> \### Description
> Device flow now is as RFC86…28 which improves security because it prevented response\_code accidently leakage. 
> \### Use case
> All SSO scenario.

This would open up more possibilities for applications on devices.

It would also help get EveMon working on Linux and macOS, see [Crash on Wine due to unimplemented native HTTPListener · Issue #9 · mgoeppner/evemon · GitHub](https://github.com/mgoeppner/evemon/issues/9)

CCP could at least respond to the open tickets on their SSO issue tracker.

---

<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:** [June 30, 2022, 3:19pm UTC](https://forums.eveonline.com/t/esi-authorization-for-apps-and-services-with-no-browser-access-or-ui/352279/20 "2022-06-30T15:19:10Z")

</div>

Closed on June 30, 2022, 3:19pm UTC

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