问题
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