FacebookGraphAPIError: (#210) This call requires a Page access token
FacebookGraphAPIError: (#210) This call requires a Page access token
我正在使用 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.
如何传递页面访问令牌?或者这与其他事情有关?
我找到问题了。这与访问令牌无关。我的某些 profileFields 参数无效。修改后的工作代码如下:
new FacebookStrategy(
{
clientID: authConfig.facebookAuth.clientID,
clientSecret: authConfig.facebookAuth.clientSecret,
callbackURL: authConfig.facebookAuth.callbackURL,
profileFields: [
"id",
"displayName",
"email",
"gender",
"picture.type(large)"
]
}
我正在使用 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.
如何传递页面访问令牌?或者这与其他事情有关?
我找到问题了。这与访问令牌无关。我的某些 profileFields 参数无效。修改后的工作代码如下:
new FacebookStrategy(
{
clientID: authConfig.facebookAuth.clientID,
clientSecret: authConfig.facebookAuth.clientSecret,
callbackURL: authConfig.facebookAuth.callbackURL,
profileFields: [
"id",
"displayName",
"email",
"gender",
"picture.type(large)"
]
}