title: passport-facebook-token returns InternalOAuthError: Failed to fetch user profile when verifying the token
body: <p>I have an iOS app in which I use Facebook API for logging in, and I get an access token in response. Now I want to use this token to authenticate user on my backend server.</p>
  
  <p>I'm using passport-facebook-token strategy for Passport.js.</p>
  
  <pre><code> var FacebookTokenStrategy = require('passport-facebook-token');
  
   module.exports = function(app) {
        app.use(passport.initialize());
        app.use(passport.session());
  
        passport.use(new FacebookTokenStrategy({
          clientID: '32424222424024',
          clientSecret: '3292e42148264c2817523232446187',
          callbackURL: "http://localhost:3000/auth/facebook/callback"
        },
  
        function(accessToken, refreshToken, profile, done) {
          User.findOne({ facebookId: profile.id }, function (err, user) {
              console.log("facebook");
              return done(err, user);
          });
        }   
        ));
  
      app.get('/auth/facebook',
          passport.authenticate('facebook-token'),
          function (req, res) {
              res.send(req.user? 200 : 401);
          }
      );
   };
  </code></pre>
  
  <p>But when I call <a href="http://localhost:3000/auth/facebook?access_token=my_token_here" rel="noreferrer">http://localhost:3000/auth/facebook?access_token=my_token_here</a> I get following error:</p>
  
  <blockquote>
    <p>InternalOAuthError: Failed to fetch user profile
        at C:\app\www\app\node_modules\passport-facebook-token\lib\index.js:152:32
        at passBackControl (C:\app\www\app\node_modules\oauth\lib\oauth2.js:123:9)
        at IncomingMessage. (C:\app\www\app\node_modules\oauth\lib\oauth2.js:143:7)
        at emitNone (events.js:72:20)
        at IncomingMessage.emit (events.js:166:7)
        at endReadableNT (_stream_readable.js:905:12)
        at nextTickCallbackWith2Args (node.js:474:9)
        at process._tickCallback (node.js:388:17)</p>
  </blockquote>
  
  <p>What steps in app configuration and/or authentication implementation am I'm missing?</p>