Search code examples
twittertwitter-oauthtwitter-api-v2

I am getting a 403 error when trying to implement OAuth 1.0a with twitter API


i am trying to generate a OAuth 1.0a link with twitter api in JS using the twitter-api-v2

const client = new TwitterApi({ appKey: process.env.API_KEY, appSecret: process.env.API_KEY_SECRET });

app.listen(3000, () => console.log("You used express to set up a server!"));

app.get("/callback", (req, res) => {
  console.log(req);
});

const authLink = await client.generateAuthLink("localhost:3000/callback");

i have checked my credentials, and have setup OAuth 1.0a on the twitter developer portal.


Solution

  • Turns out, i made a mistake, and just needed to edit the URL in my twitter developer portal.