Home > DeveloperSection > Forums > Spring social Facebook oauth - getting not all data with api v2.5
jimmy Smith
jimmy Smith

Total Post:3

Posted on    December-11-2015 12:57 AM

 Java Java 

 1 Reply(s)
 622  View(s)
Rate this:
I am trying to implement facebook oauth using Spring Social, as a part of it I call the following uri


And I get the token just fine. However, when I try

Facebook facebookTemplate = new FacebookTemplate(accessToken);
FacebookProfile facebookProfile = facebook.userOperations().getUserProfile();
The api returns the full facebook profile with all the data (email, link etc) only in case if I've configured my app to use Facebook app in developers console which uses api 2.3. As for today the up-to-date version of api which is used by all newly created apps in the console is 2.5. In case I use newly created app with api 2.5 it returns not all data - basically only user name and id are present. I use Spring social facebook version 1.1.1.RELEASE and Spring social 1.1.0.RELEASE

Can I specify some parameter or update libraries or code, so that I get all the data using newly created apps with api version 2.5?

Mayank Tripathi
Mayank Tripathi

Total Post:397

Posted on    December-11-2015 1:17 AM

Spring Social Facebook v2.0.3.RELEASE targets Graph API v2.5 and should include the fields you are looking for.You are missing the scope. By default scope of spring-social-facebook is public_profile. It will only have some limited information.

Use "email scope" instead. Refer this link Facebook oauth scopes

You can change the scope in this way facebookConnectionFactory.setScope("email")

Don't want to miss updates? Please click the below button!

Follow MindStick