mamod / Net-Facebook-Oauth2

a simple Perl wrapper around Facebook OAuth v2.0 protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get_access_token not working / API changes

ToRu82 opened this issue · comments

get_access_token is always returning "can't get access token", even if a valid token has been return.

This seems to be the reason:
"Note: From v2.3 onward this endpoint will return a proper JSON response. If your call doesn't specify a version it will default to the oldest available version."

I think the oldest available version returns JSON now, but the script still tries to parse xml and fails.

I also face this issue. The code of the module indeed needs an update to parse the JSON response.

I can't believe this is opened since 25 days, sorry for that, I was doing a manual tests and everything seemed to work for me

@ToRu82 @coudot I'm not sure what do you mean by JSON parse, the module already deals with JSON responses, I might be missing something but there is no XML parsing involved at all.

do you get this error at the callback redirect step? does the callback URL has a code param? and if possible can you paste the response passed with the can't get access token error message, this error will also pass the content of the response, it doesn't has to have the access token though :)

Hello @mamod,

seems this was fixed in commit 52c6418, but the version containing this fix is not yet released. So when using the release from standard GNU/Linux distributions, we are unable to get the module working.

@ToRu82 @coudot but... but... version 0.10 containing the fix was released to CPAN on October 2016. How were you trying to install it? Where are you getting the old version from? Could it be some downstream packager like Debian or RedHat?

Otherwise, I think it's safe to close this issue :)

I installed it using the ubuntu package manager (apt). On Ubuntu 16.04. it was version 0.09, but you're right, on ubuntu 18.04. it is 0.10 now. So yes, it can be closed :)