twit icon indicating copy to clipboard operation
twit copied to clipboard

'Could not authenticate you.'

Open mikeymurph77 opened this issue 3 years ago • 4 comments

I am trying to log in to post tweets on behalf of my own account from my app. I have not been able to move past the following error:

{ errors: [ { code: 32, message: 'Could not authenticate you.' } ] }

Previously I was using a different Twitter client which had issues with authentication and how my keys were generated.

The following is my code that fails to authenticate.

// /utils/twitterConfig.js
module.exports = {
  consumer_key: process.env.TWITTER_API_KEY,
  consumer_secret: process.env.TWITTER_API_SECRET,
  access_token: process.env.TWITTER_ACCESS_TOKEN,
  access_token_secret: process.env.TWITTER_ACCESS_SECRET,
};
// index.js
import twitterConfig from "../utils/twitterConfig";
import twit from "twit";
...
const Twitter = new twit(twitterConfig);
const tweets = Twitter.get(
        "search/tweets",
        { q: "banana since:2011-07-11", count: 100 },
          function (err, data, response) {
            console.log(data);
        }
);

Any idea what's going on here?

mikeymurph77 avatar Dec 27 '22 22:12 mikeymurph77

Believe you need elevated access on twitter api

ShayanJa avatar Jan 04 '23 15:01 ShayanJa

Did you ever figure this out? I just started getting this on a combination of keys/secrets that have been working for months. Do you know if this is related to the new twitter API rate limit?

tylerpashigian avatar May 21 '23 15:05 tylerpashigian

Did you ever figure this out? I just started getting this on a combination of keys/secrets that have been working for months. Do you know if this is related to the new twitter API rate limit?

@tylerpashigian happening the same to me here, did you figure this out already?

geneoes avatar May 24 '23 20:05 geneoes

Did you ever figure this out? I just started getting this on a combination of keys/secrets that have been working for months. Do you know if this is related to the new twitter API rate limit?

@tylerpashigian happening the same to me here, did you figure this out already?

Yeah, it looks like the new API changes finally went into effect. If you go to your developer dashboard for the account you're trying to access, you'll see that account/project is suspended (assuming you have the same issue I did).

I just had to select an API tier (I selected free) and agree to it, I was good to go after that.

tylerpashigian avatar May 24 '23 20:05 tylerpashigian