I am using FbGraph in my Ruby on Rails app along with Omniauth. I am using the server-side method to get the long-term (60 day) access token for the user and then storing it in a session variable. When trying to access the API in the following code:
token = session[:facebook_token]
user = FbGraph::User.me(token)
user = user.fetch
I get OAuthException :: Invalid OAuth access token
. However when I add puts token
and copy the printed token into the Facebook Graph API Explorer (online tool) I have no issues and the token is reported as valid ... I can even make the API call that's failing through FbGraph.
I was using the short term tokens from the JavaScript SDK (2 hour) and the same code was working fine so something about the move to the long term token is screwing everything up.