FacebookError: OAuthException – Invalid OAuth access token

On places.ae, we got notified of some issues with Facebook signups and logins. All of the sudden, when the Facebook OAuth service pushed us back to our redirect-page, the HyperGraph Gem threw the following error:

FacebookError: OAuthException – Invalid OAuth access token

This is often thrown because the Access Token could contain a | (pipe) character, which gets encoded to %7C, and this makes HyperGraph choke a bit. So a simple gsub(‘%7C’,’|’) will solve it, such as the code below:

at = HyperGraph.get_access_token(FB_ID, FB_SECRET, FB_RET, code)
at = at.gsub(‘%7C’,’|’)
g = HyperGraph.new(at)
me = g.get(‘me’)

Thanks,
Michael


Posted

in

, ,

by

Tags:

Comments

One response to “FacebookError: OAuthException – Invalid OAuth access token”

  1. […] we had a small error with facebook logins, due to an HTML encoded access token which we didn’t escape […]

Leave a Reply

Your email address will not be published. Required fields are marked *