nsanta / fbgraph

Facebook Open Graph API in Ruby
MIT License
324 stars 40 forks source link

Strange problem with fbgraph authorization (Exchange Sessions Not Implemented) #7

Closed nielsjansendk closed 14 years ago

nielsjansendk commented 14 years ago

Hi

I really hope you can shed some light at this problem I am having, I am using the fbgraph_example application and I cannot get it to show me the authorization screen when I use it from facebook. I am in my development environment and I use an ssh tunnel to communicate with facebook.

This is what I do: I make sure the app is not authorized on my facebook account, then I go the the app page on facebook and after a long time I get an error (the facebook logo is show with a link that says "go to facebook"). Facebook never calls the callback method. However, and this is the strange part if I point my browser directly to the start method (i.e. localhost:3000/oauth/start), I do get an authorization screen where I can authorize the app, then I get sent back to my app on facebook and everything works.

Does this have to do with the fact that I am in development or is this a problem with FBgraph? Does this happen for you as well?

nsanta commented 14 years ago

ninajansen: Please, create a gist with the source code or a similar example.

Thanks

nielsjansendk commented 14 years ago

The source code is the one from the example app:

http://github.com/nsanta/fbgraph_example

I only changed the client_id and client_secret to match my facebook app. The rest is the same.

nsanta commented 14 years ago

haha, Let me take a look.

nsanta commented 14 years ago

I tested my example app and the flow of authorization is completed as the expected.

I reviewed your comment and seems that the access_token has expired. Facebook provides perishable acess tokens on authorizations, except if you request the offline_access permission to the facebook user (gives you permanent access_token). There is a way to handle the perishable access_token: requesting the exchange sessions (not implemented on fbgraph yet). I will keep opened this issue as a reminder for implement exchange sessions.

Regards.

nielsjansendk commented 14 years ago

Okay, I didn't ask for offline_access permission. That is probably the problem. I will try again, thanks!

nsanta commented 14 years ago

Implemented Exchange Sessions. On master branch