删除offline_access并使用访问令牌

问题描述:

我尝试尽可能具体描述我在做什么以及我的问题是什么:简而言之,我“劫持”某个访问令牌并使用它来下载XML数据。这里是长版本:删除offline_access并使用访问令牌

首先我在一些应用程序的帮助下生成访问令牌。应用程序是不是我的,我认为一个人可以使用任何应用程序: https://graph.facebook.com/oauth/authorize?client_id=xxxxxxxx&redirect_uri=http://apps.facebook.com/xxxxxxx/&scope=offline_access,email,read_insights,read_stream,user_about_me,user_activities,user_birthday,user_education_history,user_events,user_groups,user_hometown,user_interests,user_likes,user_location,user_notes,user_online_presence,user_photo_video_tags,user_photos,user_relationships,user_religion_politics,user_status,user_videos,user_website,user_work_history,user_checkins,read_friendlists,read_requests,friends_about_me,friends_activities,friends_birthday,friends_education_history,friends_events,friends_groups,friends_hometown,friends_interests,friends_likes,friends_location,friends_notes,friends_online_presence,friends_photo_video_tags,friends_photos,friends_relationships,friends_religion_politics,friends_status,friends_videos,friends_website,friends_work_history,friends_checkins&type=user_agent

对此我得到的URL访问令牌:=的access_token AAAAA .....

然后我用这个来的access_token访问某些信息:

https://api.facebook.com/method/fql.query?access_token = AAAAA .... & query = SELECT%20uid,%20first_name,%20last_name,%20online_presence%20FROM%20user% 20WHERE%20uid = [friend-uid]

到目前为止,这项工作非常好,我不必更新访问令牌但新的更改我只能得到一个有效2小时的令牌。这对我来说太短了,因为我在WGET脚本中使用了该标记。我无法交换令牌,因为我没有关于该应用的更多信息。有什么办法可以克服我的问题吗?我不想让自己的应用程序只获取一些信息。我不想给FB我的cc。现在的方式对我来说很好。

感谢您的帮助。

你写道,该应用程序是不是你的,你可以使用电话号码和短信验证注册为Facebook开发人员,如果你喜欢,而不是你的cc。

+0

感谢您的回答。我已经在文档的帮助下计算出了这一点,但是由于我写的我没有APP_SECRET,因为它不是我的应用程序!我真的必须创建我自己的应用程序吗? – 2012-07-20 07:16:31

+0

我想没有办法让应用程序访问令牌,我想你可以尝试自动化浏览器登录到Facebook并导航,直到它获得一个令牌,但这将是非常脆弱的。 – complex857 2012-07-20 07:22:29

+0

坦率地说,我不会给FB我的手机号码,当然不是我的CC的详细信息! – 2012-07-20 12:17:52