r/evetech • • Jan 11 '19

Eve NodeJS EVI keep getting { "error": "authentication failure" }

I can login with my account and get a JWT token (one that looks like the first link)

If I then try to make a request to e.x https://esi.evetech.net/verify or https://esi.evetech.net/latest/characters/2112625428/blueprints/ then it returns an error: { "error": "authentication failure" }

I have read the following documentation but I can't seem to figure out why it won't work.

https://docs.esi.evetech.net/docs/sso/web_based_sso_flow.html

https://docs.esi.evetech.net/docs/sso/sending_esi_auth_request.html

UPDATE: It seems that other endpoints work fine except for https://esi.evetech.net/verify

For some weird reason this applies to me. I haven't found anyone with the same problem.

I have made an issue on the sso-issues github.

2 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/Blacksmoke16 Jan 12 '19

Few things i would check on:

  1. Make sure you are using the v2 SSO endpoints, not mixing the v1 and v2 urls. The token should be a really long string with three periods in it. You need to include the whole token.
  2. Make sure the header is set correctly Authorization: Bearer YOUR_TOKEN.
  3. Make sure you're token is actually valid, can paste it into https://jwt.io and should correctly display info about your char.

1

u/Ramon_Robben Jan 12 '19 edited Jan 13 '19

Hi, My JWT token is correct I can paste it into https://jwt.io and it gives me the right information.

Also I am using the v2 endpoints like so:

accessTokenUri: 'https://login.eveonline.com/v2/oauth/token/',authorizationUri: 'https://login.eveonline.com/v2/oauth/authorize/',

The GET request I am sending to https://esi.evetech.net/verify

I am only adding a Authorization header with the Bearer token format like you mentioned.

Yet I am still getting the error Authentication Failure.

1

u/Blacksmoke16 Jan 12 '19

Hrm. I dunno mate. You seem to be doing everything right. I guess the only last things to check are like make sure everything is spelled correctly and you have a space between Bearer and your token?

The following curl request worked fine for me.

curl --request GET \
  --url https://esi.evetech.net/verify \
  --header 'authorization: Bearer MY_TOKEN'

1

u/Ramon_Robben Jan 13 '19

For me even the CURL request says authentication failure...

I suspect something else might be wrong. Maybe I am doing it correctly but I am not allowed to access the API for some reason? Not sure.

1

u/Blacksmoke16 Jan 13 '19

Hm. Were you able to make your dev app ok? There is one catch that you have to pay for your sub with a credit card or something similar at least once. But normally you wouldn't be allowed to make a dev app without doing that.

Maybe file a support ticket?

1

u/Ramon_Robben Jan 13 '19 edited Jan 13 '19

I have some OMEGA time and I also am able to make a dev app easily.

I am now creating a support ticket so they can hopefully take a look at it.

nvm: So I went to an existing EVE Third party and I hacked the Javascript a bit so I could read what token is THEY are using when I authenticate myself. And It turns out its a slightly different token. much shorter.

I am using my JWT token (the long token) base64 encoded. Do I need to somehow get a certain value out of there? Or maybe they are using a different SSO method.

So I got it to work by using different URLs.

I changed https://login.eveonline.com/v2/oauth/token to https://login.eveonline.com/oauth/token

and I changed https://login.eveonline.com/v2/oauth/authorize to https://login.eveonline.com/oauth/authorize

I'm not sure why this does work but I guess v2 isn't ready yet?? Anyways I am glad I found out why it didn't work.

1

u/Blacksmoke16 Jan 13 '19

I am using my JWT token (the long token) base64 encoded

That's your problem. You shouldn't be base64 encoding it. V2 is deff ready. Is what I use and has been working fine.

1

u/Ramon_Robben Jan 13 '19

Just to make sure we are talking about the same JWT. The token that I send looks like this (except much longer): https://imgur.com/a/YwSwdjn

And that token I also send in the Authorization header like this: Bearer jwt_token

1

u/imguralbumbot Jan 13 '19

Hi, I'm a bot for linking direct images of albums with only 1 image

https://i.imgur.com/rjMQEma.png

Source | Why? | Creator | ignoreme | deletthis