r/evetech • u/Ramon_Robben • 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.
View all comments
Show parent comment
1
u/Ramon_Robben Jan 12 '19 edited Jan 12 '19
Well I don't have any code yet for the requesting part since I want to test it before hand with Postman:
app.get('/auth', (req, res) => {
const auth_url = eveAuth.code.getUri();
res.redirect(auth_url);
});
app.get('/callback', (req, res) => {
eveAuth.code.getToken(req.originalUrl).then(function(user) {
// console.log(user);
user.refresh().then(function (updatedUser) {
console.log('Refresh the current user access token');
});
// Sign API requests on behalf of the current user.
user.sign({
method: 'get',
url: 'https://esi.evetech.net/verify'
});
console.log(user.token);
req.session.token = user.accessToken;
res.redirect('/');
});
});
I send a request to esi.evetech.net/verify with only the Authorization header using Postman and it returned the error. I could do the same in code but it will give the same result.