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

FacebookConnectorOAuth2Adapter fails to parse callback ... again. #32

Open
djuang1 opened this issue Mar 29, 2017 · 2 comments
Open

FacebookConnectorOAuth2Adapter fails to parse callback ... again. #32

djuang1 opened this issue Mar 29, 2017 · 2 comments

Comments

@djuang1
Copy link
Contributor

djuang1 commented Mar 29, 2017

It looks like there was a change to the Facebook API again. A previously resolved issue (#7) changed the regex to parse the 'access_token'. Unfortunately the API changed to return the access_token in a JSON string:

OAuth access token could not be extracted from: {"access_token":"EAAPagjevSIQBABinpezeZAU5XzZBlKaa1r4jEIa043NB01mDHZACn9H7mBbirBzYbUkIqOv75AcCFFWvTiAX4dAq4cgONcx7xwcOxYYQIJt4Xf7ABUD9A5N0huFc3yZA96asIRrZBltpaeIKr5FlkH8sNN4AdTxoZD","token_type":"bearer","expires_in":5178113}

Changing the patterns back to the following in FacebookOAuthStrategy.java at lines 14 and 15 allows the adapter to successfully extract the access code and expiration:

accessTokenRegex = "\"access_token\":\"([^&]+?)\""
expirationRegex = "\"expires_in\":([^&]+?),")

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

No branches or pull requests

2 participants
@djuang1 and others