In order to get a Twitter Access Token, you have to retrieve the full user's profile, using the Auth0 Management API, and extract the Access Token from the response.
So upon first glance it seems that something may have changed in the Twitter API and we might need to adjust - we’ll look into that to see what’s going on
Hi @edent.
I’m guessing this was either an oversight or that the profile’s screen_name wasn’t available when this connection type was implemented in Auth0. I will report this internally so hopefully this will eventually get fixed.
In the meantime, a good workaround is to create the following rule:
function (user, context, callback) {
// Put the user's screen_name as the nickname
// for Twitter connections
if (context.connection === 'twitter' && user.screen_name) {
user.nickname = user.screen_name;
}
callback(null, user, context);
}
This will modify the information that applications get (either from the ID Token or from the /userinfo endpoint), but will not modify the actual user profile stored. Keep that in mind that if you use /api/v2/users or the dashboard to get the full user profile will still see the full name in the nickname property.
This works easily enough but this is pretty inconvenient. I would have expected this to be addressed by now, but seems to be an issue over a year later.