2012-07-20 100 views
-1

我嘗試儘可能具體描述我在做什麼以及我的問題是什麼:簡而言之,我「劫持」某個訪問令牌並使用它來下載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。現在的方式對我來說很好。

感謝您的幫助。

回答

0

你寫道,該應用程序是不是你的,你可以使用電話號碼和短信驗證註冊爲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

相關問題