Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Facebook login exception starting November 2020 #281

Open
mihajul opened this issue Dec 17, 2020 · 1 comment
Open

Facebook login exception starting November 2020 #281

mihajul opened this issue Dec 17, 2020 · 1 comment

Comments

@mihajul
Copy link

mihajul commented Dec 17, 2020

We started getting the below exception when trying to login with facebook.

org.springframework.social.UncategorizedApiException: (#100) 
Tried accessing nonexisting field (security_settings) 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.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:818)
org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:776)
org.springframework.web.client.RestTemplate.execute(RestTemplate.java:750)
org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:351)
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)

As a workaround we removed the missing fields from the PROFILE_FIELDS array in UserOperations.java

Per facebook documentation:

Deprecated Fields
Deprecated in v8.0+. Will be deprecated in all versions on Nov, 2020.

security_settings
test_group
viewer_can_send_gift
is_shared_login

@vzorlu
Copy link

vzorlu commented Feb 23, 2021

Add the file to your file as static, it is the edited file.
build.gradle --> compile fileTree(dir: 'libs', include: ['*.jar'])

https://drive.google.com/file/d/1190dp3mvcPV7NKyt2DmwQ8tSv48HITZn/view?usp=sharing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants