I am using Spring social Facebook framework 2.0.2 and I am accessing an Facebook app version 2.5.
I, somehow, cannot grab the email address of the user that is authenticating via the fetchObject method.
@RequestMapping("/register/facebook")
public String registerFacebookUser(WebRequest request, Model model) {
Connection<Facebook> connection = (Connection<Facebook>)providerSignInUtils.getConnectionFromSession(request);
User profile = connection.getApi().fetchObject("me", User.class, "id", "first_name", "last_name", "link", "email");
userConnectionRepository.createConnectionRepository(profile.getId()).addConnection(connection);
return "register";
}
Id, first name and last name works perfectly but the email address seems to be null. I have registered an email address to Facebook, verified it correctly and is publicly available though.
My first guess is that the version used by Spring social Facebook is 2.3 when I look into the code. Do you think that might be that?