开发者

RoR - How to obtain an access token for the facebook user using OAuth?

开发者 https://www.devze.com 2023-01-12 09:47 出处:网络
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.

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消