auth0 / omniauth-auth0

OmniAuth strategy to login with Auth0
MIT License
125 stars 67 forks source link

Returned Twitter nickname is not same as user's actual Twitter handle #84

Closed nileshtrivedi closed 5 years ago

nileshtrivedi commented 5 years ago

Description

I found a thread in forum about the same issue with no resolution: https://community.auth0.com/t/twitter-nickname-is-not-the-same-as-screen-name/17297

Unlike every other social login provider, Twitter strategy returns request.env['omniauth.auth']['info']['nickname'] value which is NOT the user's Twitter handle.

The workaround of adding this rule in Auth0 dashboard does work:

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);
}

Prerequisites

Environment

albertoperdomo commented 5 years ago

Hello @nileshtrivedi,

thanks for taking the time to report issues. The issue you are experiencing is not a specific issue with omniauth-auth0, but an issue with the Twitter connection itself. We are aware of this issue and have an item in our backlog to address this.

In the meantime, the workaround of using that rule should still be valid, AFAIK. Closing this issue as it can not be addressed in this library.