Constantly getting Unauthorized
lologrignola opened this issue · 5 comments
I'm trying to make a "automated" login and when trying to log in I'm getting { status: 401, statusText: 'Unauthorized' } in the request response.
Code looks like this:
Code:
const credentials = await authenticate({
name: "RiotClientUx",
});
try {
const response = await request(
{
method: "POST",
url: "/rso-auth/v1/authorization/gas",
body: {
password: pass,
platformId: "LA2",
username: user,
},
},
credentials
);
console.log(response);
} catch (error) {
console.log(error);
}
Ty!
I don't know what this endpoint expects, but I assume it's not accepting the same credentials as the other LCU endpoints. Do you have more of the HTTP response available?
Hi, thanks for the quick reply!
Yes, this is the complete Response:
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://127.0.0.1:55190/rso-auth/v1/authorization/gas',
status: 401,
statusText: 'Unauthorized',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: undefined
}
}
Thanks
What headers are sent back from the LCU? Maybe the credentials used to authenticate to this endpoint differ from the other LCU ones?
I understand little about this, sorry, but it could be the issues yes
Headers {
[Symbol(map)]: [Object: null prototype] {
'content-length': [ '93' ],
vary: [ 'origin' ],
'content-type': [ 'application/json' ],
'access-control-allow-origin': [ 'http://127.0.0.1:55190' ],
'www-authenticate': [ 'Basic realm="RiotRemoting"' ]
}
}
Yeah I guess that rso-auth endpoint is probably configured to use something else for authentication then. I wouldn't be able to tell without knowing how that endpoint behaves, but I've never seen it before