gpt4 book ai didi

node.js - FacebookGraphAPI错误: (#210) This call requires a Page access token

转载 作者:太空宇宙 更新时间:2023-11-03 23:21:19 25 4
gpt4 key购买 nike

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

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.

如何传递页面访问 token ?或者这与其他事情有关?

最佳答案

我已经发现问题了。这与访问 token 无关。我的一些 profileFields 参数无效。修改后的工作代码如下:

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

关于node.js - FacebookGraphAPI错误: (#210) This call requires a Page access token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49433359/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com