How to use the passport-facebook-token.Strategy function in passport-facebook-token

To help you get started, we’ve selected a few passport-facebook-token examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xiexiangyi0 / PicsHouse-Android / server / util / auth.js View on Github external
require("../model/user").findOne({token : token}, function(err, user) {
            if(err) {
                return done(err);
            }

            if(user) {
                return done(null, user);
            } else {
                return done(null, false, {message : "invalid_token"});
            }
        });
    })
);

passport.use(
    new FBTokenStrategy({
        clientID : app_config.FB_CLIENT_ID
        , clientSecret : app_config.FB_CLIENT_SECRET
    }
    , function(accessToken, refreshToken, profile, done) {
            var User = require("../model/user");
            //console.log(profile);
            User.findOne({"facebook.id" : profile.id}, function(err, user) {

                if(err) {
                    return done(err);
                }

                if(user) {
                    user.token = accessToken;
                } else {
github Talento90 / node-project-struct / config / passport.js View on Github external
firstName: profile._json.first_name,
            lastName: profile._json.last_name,
            email: profile._json.email
          };

          User.create(user, function(err, user){
            if(err){ return done(err, null); }
            return done(err, user);
          });
        }

      });
    });
  }));

  passport.use(new FacebookTokenStrategy({
    clientID: config.passport.facebook.clientID,
    clientSecret: config.passport.facebook.clientSecret
  },
  function(accessToken, refreshToken, profile, done) {
    User.findOrCreate({ facebookId: profile.id }, function (err, user) {
      return done(err, user);
    });
  }));

}
github ghaiklor / generator-sails-rest-api / generators / app / templates / config / passport.js View on Github external
code: 'E_AUTH_FAILED',
          message: [profile.provider, ' auth failed'].join('')
        });

        return next(null, user, {});
      })
      .catch(next);
  } else {
    req.user.socialProfiles[profile.provider] = profile._json;
    req.user.save(next);
  }
}

passport.use(new LocalStrategy(_.assign({}, LOCAL_STRATEGY_CONFIG), _onLocalStrategyAuth));
passport.use(new JwtStrategy(_.assign({}, JWT_STRATEGY_CONFIG), _onJwtStrategyAuth));
passport.use(new FacebookTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new TwitterTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new VKontakteTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new FoursquareTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new GitHubTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new InstagramTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new PayPalTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new RedditTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new SoundCloudTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new WindowsLiveTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new TwitchTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new YandexTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new AmazonTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new GooglePlusTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
passport.use(new YahooTokenStrategy(_.assign({}, SOCIAL_STRATEGY_CONFIG), _onSocialStrategyAuth));
github BernardTolosajr / ember-cli-koa-facebookauth-example / auth-server / config / passport.js View on Github external
module.exports = function(passport) {
  passport.serializeUser(serialize);
  passport.deserializeUser(deserialize);
  passport.use(new FacebookTokenStrategy({
    clientID: 'facebook_id',
    clientSecret: 'facebook_secrect_key',
    redirectURL: 'facebook_redirect_url'
  }, facebookAuth));
};

passport-facebook-token

Facebook token authentication strategy for Passport

MIT
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis

Popular passport-facebook-token functions