spring-attic / spring-social-facebook

Facebook API binding and connect support.
http://projects.spring.io/spring-social-facebook
Apache License 2.0
248 stars 269 forks source link

Facebook login exception after API 2.9 is disabled #278

Open mihajul opened 5 years ago

mihajul commented 5 years ago

We started getting the following exception when trying to login with facebook. As a workaround we removed "context" from the PROFILE_FIELDS array in UserOperations.java

`

org.springframework.social.UncategorizedApiException: (#100) Tried accessing nonexisting field (context) on node type (User)

org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleFacebookError(FacebookErrorHandler.java:91) org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleError(FacebookErrorHandler.java:59) org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:709) org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:662) org.springframework.web.client.RestTemplate.execute(RestTemplate.java:637) org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:312) org.springframework.social.facebook.api.impl.FacebookTemplate.fetchObject(FacebookTemplate.java:225) org.springframework.social.facebook.api.impl.FacebookTemplate.fetchObject(FacebookTemplate.java:220) org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:53) org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:49) org.springframework.social.facebook.connect.FacebookAdapter.fetchUserProfile(FacebookAdapter.java:50) org.springframework.social.facebook.connect.FacebookAdapter.fetchUserProfile(FacebookAdapter.java:30) org.springframework.social.connect.support.AbstractConnection.fetchUserProfile(AbstractConnection.java:111) `

SimonCigoj commented 5 years ago

@mihajul how dod you do this I have the same problem?

mihajul commented 5 years ago

@mihajul how dod you do this I have the same problem?

I added the following file in the "src/main/java/org/springframework/social/facebook/api/" folder inside my project:

https://github.com/mihajul/spring-social-facebook/blob/d11eac37f3a79f74ef7b65576ae49b73a463e232/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/UserOperations.java

mathieuruellan commented 5 years ago

@mihajul Thank you! Works fine for me!