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

孤街浪徒 提交于 2019-12-11 08:36:38

问题


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) {

This is giving me the following error:

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

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


回答1:


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)"
        ]
      }


来源:https://stackoverflow.com/questions/49433359/facebookgraphapierror-210-this-call-requires-a-page-access-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!