FacebookGraphAPIError:(#210)此调用需要页面访问令牌 [英] FacebookGraphAPIError: (#210) This call requires a Page access token

查看:92
本文介绍了FacebookGraphAPIError:(#210)此调用需要页面访问令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Passport-Facebook策略进行身份验证.请在下面找到代码:

I am using Passport-Facebook strategy for authentication. Please find the code below:

new FacebookStrategy(
      {
        clientID: authConfig.facebookAuth.clientID,
        clientSecret: authConfig.facebookAuth.clientSecret,
        callbackURL: authConfig.facebookAuth.callbackURL,
        profileURL: "https://graph.facebook.com/v2.10/me",
        authorizationURL: "https://www.facebook.com/v2.10/dialog/oauth",
        tokenURL: "https://graph.facebook.com/v2.10/oauth/access_token",
        profileFields: ["email", "profile_pic", "gender"]
      },
      function(accessToken, refreshToken, profile, done) {

这给了我以下错误:

FacebookGraphAPIError: (#210) This call requires a Page access token.

如何传递页面访问令牌?还是这与别的东西有关?

How do I pass the page access token? Or is this related to something else?

推荐答案

我发现了问题.这与访问令牌无关.我的某些profileFields参数无效.修改后的工作代码如下:

I have found the problem. This had nothing to do with the Access token. Some of my profileFields parameters were invalid. The modified, working code is given below:

new FacebookStrategy(
      {
        clientID: authConfig.facebookAuth.clientID,
        clientSecret: authConfig.facebookAuth.clientSecret,
        callbackURL: authConfig.facebookAuth.callbackURL,
        profileFields: [
          "id",
          "displayName",
          "email",
          "gender",
          "picture.type(large)"
        ]
      }

这篇关于FacebookGraphAPIError:(#210)此调用需要页面访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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