Can't authenticate
See original GitHub issueThe authentication works perfectly with twit, but with twitter-lite all the request I tried were denied.
I used the basic example.
If I do the user authentication as following:
client = new Twitter({ consumer_key, consumer_secret, access_token, access_token_secret });
The output is:
{ _headers: Headers { [Symbol(map)]: [Object: null prototype] { 'cache-control': [Array], connection: [Array], 'content-encoding': [Array], 'content-length': [Array], 'content-type': [Array], date: [Array], server: [Array], 'set-cookie': [Array], 'strict-transport-security': [Array], 'x-connection-hash': [Array], 'x-response-time': [Array] } }, errors: [ { code: 89, message: 'Invalid or expired token.' } ] }
If I include the bearer_token
in the constructor, the output is this:
{ _headers: Headers { [Symbol(map)]: [Object: null prototype] { 'cache-control': [Array], connection: [Array], 'content-encoding': [Array], 'content-length': [Array], 'content-type': [Array], date: [Array], server: [Array], 'set-cookie': [Array], 'strict-transport-security': [Array], 'x-connection-hash': [Array], 'x-response-time': [Array] } }, errors: [ { message: 'Your credentials do not allow access to this resource', code: 220 } ] }
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:5
Top GitHub Comments
I got the same issue reported, however, not all my requests failed, it’s just some of them. I wonder whether I should create the client for every API request, instead of using the same client instance for all requests with the same tokens. (To me, ideally, they should be the same, though)
Yep, same here as well.