(OAuthException) (#15) The method you are calling must be called with an app secret signed session

烂漫一生 提交于 2019-11-29 15:27:35

I guess the error and the old naming is a bit misleading, what you need here is an application access token. And it's mentioned in the Test Users documentation:

You can create a test user associated with a particular app using the Graph API with your app access token.

For PHP users, I've written a tutorial on how to get this access token here.

You need a valid access token to include in your URI, such as "&access_token=APP_ACCESS_TOKEN". Try Facebook's Access Token Tool.

I noticed you didn't share your solution, it's important to share in case others have the same issue.

Here's how I programmatically get an App client:

var fbAppClient = FacebookWebClient(AppId, AppSecret);

While late to the party, I thought I'd add the actual fix to the original code since I was running into the exact same issue.

In Kassem's above code, on the 4th line, the following:

var fb = new FacebookWebClient(FacebookWebContext.Current);

is what was causing the error in the title for me. Replacing it with:

var fb = new FacebookWebClient(FacebookApplication.Current.AppId, FacebookApplication.Current.AppSecret);

Resolved the issue.

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