# Long access\_token and 403 authentication failure

**URL:** <https://forums.eveonline.com/t/long-access-token-and-403-authentication-failure/318198>\
**Category:** Third Party Developers\
**Created:** [June 29, 2021, 12:09pm UTC](https://forums.eveonline.com/t/long-access-token-and-403-authentication-failure/318198 "2021-06-29T12:09:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zuza\_Kelzz](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/zuza_kelzz/32/500074_2.png) [@zuza\_Kelzz](https://forums.eveonline.com/u/zuza_Kelzz)\
**Post date:** [June 29, 2021, 12:09pm UTC](https://forums.eveonline.com/t/long-access-token-and-403-authentication-failure/318198/1 "2021-06-29T12:09:17Z")

</div>

Long token?

I created a pog app and selected all esi permissions.

 ![pog-permissions](https://global.discourse-cdn.com/eveonline/original/4X/d/9/1/d91cf9f517dded8a9aafbb30b08858a34b24d32a.png)

Authorization, getting a token, updating a token, everything is fine.  
/v2/oauth/authorize/  
/v2/oauth/token (get / refresh)

Any request that requires a token returns a response:  
403 {error: ‘authentication failure’}  
my request code for example

```auto
function getCharactersCharacterIdSkills(characterId, accessToken) {
  const options = {
    method: 'get',
    url: `https://esi.evetech.net/latest/characters/${characterId}/skills/`,
    headers: {
      Authorization: `Bearer ${accessToken}`,
    },
  };

  return axios(options);
}

```

I also used [EVE Swagger Interface](https://esi.evetech.net/ui/)

I think it has something to do with the length of the access\_token, because authorization through an application with fewer permissions gives a positive answer.

---

<div class="post-metadata">

**Author:** ![Def\_en\_Bauldry](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/def_en_bauldry/32/387846_2.png) [@Def\_en\_Bauldry](https://forums.eveonline.com/u/Def_en_Bauldry)\
**Post date:** [July 7, 2021, 6:09pm UTC](https://forums.eveonline.com/t/long-access-token-and-403-authentication-failure/318198/2 "2021-07-07T18:09:03Z")

</div>

OMG I’ve been bashing my head against a very hard brick wall on this too…

I have a OAuth2 flow coded up in my web app, and am having issues reading authenticated endpoints.  
I’ve followed the guide here [OAuth 2.0 for Web Based Applications | esi-docs](https://docs.esi.evetech.net/docs/sso/web_based_sso_flow.html)  
And get back an `access_token`, and I successfully use that token to verify the user:

```auto
ACCESS_TOKEN=eyJhbGciOiJ... # 4136 charectors long!

curl 'https://login.eveonline.com/oauth/verify' --header "Authorization: Bearer $ACCESS_TOKEN" | jq
{
  "CharacterID": 2116553599,
   ...
   "Scopes": "... esi-industry.read_character_jobs.v1 ..." # all the available scopes!
   ...
}

```

But then attempting to use that same token to get some authenticated API call, it returns error `403` :

```auto
curl "https://esi.evetech.net/latest/characters/2116553599/industry/jobs" -H "accept: application/json" -H "Authorization: Bearer $ACCESS_TOKEN"

{"error":"authentication failure"}

```

Your point on Swagger usage was interesting, but I could not reproduce this.  
Authorising on there with all the scopes, gives me a access\_token that both works on their Swagger UI and on the command line example above.

But I did prove the inverse, that from my application if I requested less scopes, it created a shorter (`879` characters) access\_token, that does also work on the command line above.

So just need to find the breaking point, and hope I don’t need more scopes than that!

---

<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:** [October 5, 2021, 6:09pm UTC](https://forums.eveonline.com/t/long-access-token-and-403-authentication-failure/318198/3 "2021-10-05T18:09:04Z")

</div>

Closed on October 5, 2021, 6:09pm UTC

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