(OAuthException)(#15)您调用的方法必须使用应用程序秘密签名会话来调用 [英] (OAuthException) (#15) The method you are calling must be called with an app secret signed session

查看:113
本文介绍了(OAuthException)(#15)您调用的方法必须使用应用程序秘密签名会话来调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试添加测试用户到我的Facebook应用程序,所以我可以更好地测试请求对话框,并检查我是否可以检索跟踪信息。但是我不断得到这个问题的标题错误。这是我的代码:

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());
    }

奇怪的是,在调试时,我检查了当前上下文似乎一切都很好。所有属性都有(包括App Secret),没有空。为什么会发生这种情况?

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?

更新: C#相当于file_get_contents(PHP)

推荐答案

错误和旧的命名有点误导,你需要这里是一个应用程序访问令牌。而且在测试用户文档中也提及:

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:


您可以使用Graph
API与您的应用访问令牌一起创建与特定应用程序关联的
的测试用户。

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

对于PHP用户,我已经写了一个关于如何获取此访问令牌的教程这里

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

这篇关于(OAuthException)(#15)您调用的方法必须使用应用程序秘密签名会话来调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆