Twitter Api returning Invalid or expired token

Hi, I am trying to use Auth0 with twitter api using nodejs. What I did:

  1. Setup up Twitter connect, tried it. Twitter user was added successfully to the Auth0.
  2. I retrieved use profile / identity by calling POST /oauth/token/
  3. I retrieved access_token (.identities[0].access_token)
  4. 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?

PS: one thing which seems odd that according to twitter the bearer token should look like something like
AAAAAAAAAAAAAAAAAAAAAMLheAAAAAAA0%2BuSeid%2BULvsea4JtiGRiSDSJSI%3DEUifiRBkKG5E2XzMDjRfl76ZC9Ub0wnz4XsNiRVBChTYbJcE3F

in my case it looks more like 18504007-jgQkuLFzwEd

I’m running into this myself - although trying to hit v2 endpoints. Anyone got a solution?