(OAuthException)(#15)您呼叫必须使用一个应用程序秘密签署会议上调用的方法 [英] (OAuthException) (#15) The method you are calling must be called with an app secret signed session

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

问题描述

我想测试用户添加到我的Facebook应用程序,所以我可以更好地验证请求对话框,并检查是否我可以检索跟踪信息。不过,我不断收到错误在这个问题的标题。这里是我的code:

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?

更新: 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:

您可以创建相关的测试用户
  用图表的特定应用程序
  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天全站免登陆