Hi, I am trying to use Auth0 with twitter api using nodejs. What I did:
- Setup up Twitter connect, tried it. Twitter user was added successfully to the Auth0.
- I retrieved use profile / identity by calling POST /oauth/token/
- I retrieved access_token (.identities[0].access_token)
- I’ve used this access_token to call “https://api.twitter.com/1.1/followers/list.json”,
Code:
var options = {
method: "GET",
url: "https://api.twitter.com/1.1/followers/list.json",
headers: {
Authorization: `Bearer ${myUser.identities[0].access_token}`,
},
};
request(options, function (error, response, body) {
console.log(body);
});
I am getting error {“errors”:[{“code”:89,“message”:“Invalid or expired token.”}]}. What am I doing wrong?