Search code examples
javascriptfacebookpassport.jsfacebook-graph-api-v2.0passport-facebook

Facebook app does not provide username


I have a PassportJS-based code which uses Facebook to login my users into the web app. I have two apps defined on Facebook. When I use one of the apps I'm getting all the info about the user (in this case the user is me), including username, hometown, etc. However, when I use another app (I change only app id and the secret, the rest of the code is the same) some of the user profile details are not available.

Do you have any idea what might be the issue here? Is it something with the app settings?


Solution

  • Apps created after 4/30/2014 use version 2.0 of the Graph API, and username is no longer provided.

    https://developers.facebook.com/docs/graph-api/reference/v2.0/user/