Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
646 views
in Technique[技术] by (71.8m points)

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

I'm trying to add Test Users to my Facebook app so I could better test the Request dialog and check if I could retrieve the tracking information. But I keep getting the error in the title of this question. Here's 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 weird thing is that while debugging, I've checked the Current context and it seems like everything is fine. All properties are there (including the App Secret) and nothing null. Why is that happening?

UPDATE: C# equivalent of file_get_contents (PHP)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...