MrJaeger
MrJaeger

Reputation: 1646

omniauth-facebook and fb_graph not working together

I am developing a rails 3.2 application and am authenticating using omniauth-facebook. This part has been giving me no problems. I get the request.env['omniauth.hash'] successfully and I extract the Oauth token as such.

auth_hash = request.env['omniauth.hash']
token = auth_hash['credentials']['token']

Afterwards I try to hit Facebook's Open Graph using fb_graph as such:

user = FbGraph::User.me(token)

However when I do this, my user is not loaded. I just get a blank user and it seems like facebook is not accepting my token as a valid token for some reason. Am I doing something wrong? Is the token I have not the one I need to make Facebook Open Graph requests? Help is much appreciated!

Upvotes: 2

Views: 282

Answers (1)

James Martin
James Martin

Reputation: 96

Try user = FbGraph::User.me(token).fetch

Upvotes: 1

Related Questions