简体   繁体   中英

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!

尝试用户= FbGraph :: User.me(令牌).fetch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM