OAuth Exception #2500

北城以北 提交于 2020-01-11 04:12:07

问题


I am trying to access my Facebook account with an App access code (because I want indefinate access - I do not want an access code which can expire)

I have tried the following code using AppId and AppSecret (which are valid) :

string accesstoken = m_AppId & "|" & m_AppSecret;
Facebook.FacebookClient fb = new Facebook.FacebookClient(accesstoken); 
Facebook.JsonObject fbMe = (Facebook.JsonObject)fb.Get("me"); 

and the last line throws an exception stating

OAuth Exception #2500 An active access token must be used to query information about the current user."

What am I doing wrong here ?


回答1:


If you're using an App Access Token, the path me cannot be determined by the Graph API, because the App Access Token is not connected to a specific User.

Solution is either specify a (app-scoped if using Graph API v2.0) user_id instead of me, or use a User Access Token.



来源:https://stackoverflow.com/questions/23907170/oauth-exception-2500

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!