简体   繁体   中英

How do I resolve the OAuthException 100 Requires user session error when accessing Facebook?

I created my app and sent a request to Facebook with the following parameters:

facebookClient.AppId = APP_ID;
facebookClient.AppSecret = APP_SECRET;
facebookClient.AccessToken = APP_ACCESS_TOKEN;

However, when I try to get page statuses, I get the error:

OAuthException 100 Requires user session

What does this error mean? How do I resolve it?

Using a Facebook C# SDK to get this error.

The user that created this app has the manage_pages permission on the page I want to get status updates from.

To query for the "page statuses", you need to pass the user_access_token , not the app_access_token .

The user access token is obtained at the authorization step. For eg:

//authorization
session = await App.FacebookSessionClient.LoginAsync("manage_pages");
string access_token = session.AccessToken;
string fb_id = session.FacebookId;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM