i want create something like "link_to" which can link to "request for permission" in facebook, so if user click "allow" then redirect to my site and i can get their data.
开发者_运维知识库my question is how to create a "link" like that? so i can get access token from facebook user. (i had register my app)
thx..
Better explained here: http://ggomeze.com/2011/05/19/post-to-facebook-from-rails-app
It's quite simple. Just redirect the user to the Facebook Auth Page:
https://graph.facebook.com/oauth/authorize?
client_id=...&
redirect_uri=http://www.example.com/callback&
scope=user_photos,user_videos,publish_stream
There're several optional parameters you can pass to get the required site.
For further Information just read the corresponding paragraph on the Facebook Documentation ("Authenticating Users in a Web Application"):
http://developers.facebook.com/docs/authentication/
精彩评论