I am using passport.js
and passport-facebook
for login on my Node.js web application. It is just a simple login request (I am only interested in the same unique id every time the same user logs on). This app has been running fine for some time. However, Facebook has just alerted me that I am using Graph API 2.3 which will be obsolete on July 10.
Where/how do I specify the Graph API version when using passport-facebook
?
The Facebook email says "We estimate one endpoint may be impacted". I wonder what passport-facebook
uses that will break. Would the tens of thousands of people using passport-facebook
would also suddenly cut of on July 10?
To answer your main question, you can specify the profileURL
in the strategy options:
const strategy = new FacebookStrategy({
clientID: FACEBOOK_APP_ID,
clientSecret: FACEBOOK_APP_SECRET,
callbackURL: CALLBACK_URL,
profileURL: 'https://graph.facebook.com/{API_VERSION}/me'
},
(accessToken, refreshToken, profile, cb) => { ... }
);
This doesn't appear to be documented anywhere; I had to look in the source code to find it. The default value is 'https://graph.facebook.com/v2.5/me'
.
Be sure to also check your app settings, since those have controls for specifying the API version.