I just re-registered our facebook app on developers.facebook.com, got the app id and secret. So far so good.
Now when I get the user profile with the new appId and appSecret, the username field is null, where as other fields like lastName etc. are set (I do UserProfile userProfile = connection.fetchUserProfile()
with spring-social-facebook).
I'm sure that the username field has been filled out previously with the old appId. I can't find out why the username now is not sent by facebook anymore. We need the username to locally store the user if he's logging in with facebook.
Is this a setting on the facebook app settings page that I'm missing? Or did something change on facebook's side?
If you've registered your app with Facebook since April 30th, then you're working against Facebook's v2.0 API (no choice...Facebook enforces it for apps registered after April 30th). In v2.0, there is no username. It's simply not available anymore.
Apps registered prior to April 30th will default to v1.0, but you can request v2.0. As it stands right now, however, Spring Social Facebook is coded against v1.0. If you try to use it against v2.0, then most things will still work, but some things won't (usernames, for example. Also, getting a list of friends will only return friends who have also authorized the same application.)
I'm working to update Spring Social Facebook's API to work against v2.0, but it's a non-trivial task. I hope to complete the work soon, though.