(OAuthException) (# 15) The method you are calling must be called using a secret application session

I am trying to add test users to my Facebook application in order to better check the query dialog and see if I can get tracking information. But all the time I get an error in the title of this question. Here is my code:

    [CanvasAuthorize]
    public ActionResult Add()
    {
        var fb = new FacebookWebClient(FacebookWebContext.Current);
        dynamic result = fb.Post(string.Format("{0}/accounts/test-users", FacebookWebContext.Current.Settings.AppId),
            new { installed = false});
        return Content(result.ToString());
    }

The strange thing is that during debugging I checked the current context and it seems that everything is in order. All objects exist (including App Secret) and nothing is invalid. Why is this happening?

UPDATE: C # equivalent for file_file_file (PHP)

+3
source share
4 answers

, , . Test Users:

API .

PHP , .

+2

URI, "& access_token = APP_ACCESS_TOKEN". Facebook .

0

I noticed that you did not share your decision, it is important to share the case if others have the same problem.

This is how I get the App client programmatically:

var fbAppClient = FacebookWebClient(AppId, AppSecret);
0
source

While I was late for the party, I decided to add the actual fix to the source code, as I was facing the same problem.

In Kassem above the code on the 4th line:

var fb = new FacebookWebClient(FacebookWebContext.Current);

- this is what caused the error in the name for me. Replacing it:

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

The problem is fixed.

0
source

All Articles