JS SDK, getTokenSilently, and Twitter API

Given a front end application that makes use of Twitter login, and using this as a guide:

I discovered getTokenSilently, and tried to make calls to Twitter’s APIs with it. Right now I’m getting CORS errors, which is to be expected, but I was curious. I copied the result from getTokenSilently and tried to make the call locally, and I get 401 unauthored errors. Any ideas why?

Btw, I have also tried using the Management API, and I get the same issue there: Twitter Api returning Invalid or expired token - #2 by marektea

Hi @raymondcamden,

The token returned from getTokenSilently is an access token issued by Auth0, not an access token issued by Twitter.

This token is not intended for use with API endpoints owned by Twitter. Instead, you are looking for IDP access tokens. Take a look at this doc for more info:

Ok, I did try this route, but had the same issues described here, Twitter Api returning Invalid or expired token. The token I got back from calling the Management API didn’t seem to ever work with Twitter.

Are you getting the same error from the twitter that is returned from the management API?

The Auth0 management API works fine - but when I use the token against Twitter, I get what the user got in the other thread - the token is expired.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.