passport-facebook

Why is passport.serializeUser executed on each request?

扶醉桌前 提交于 2019-11-30 05:49:09
I am using passport.js + passport-facebook-token to secure my API build with Strongloop's Loopback Framework. Why is passport serializing the deserialized user again after it has successfully been deserialized? Also the passport.authenticate method is called on every request! What am I doing wrong? Here is node's log: deserializeUser, id: XXXXXXXXXXXXXXXX User found. serializeUser, id: XXXXXXXXXXXXXXXX GET /api/events?access_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 304 182ms

Passport.js: passport-facebook-token strategy, login through JS SDK and THEN authenticate passport?

江枫思渺然 提交于 2019-11-29 20:29:09
I was looking for a way to let my client authorize with the facebook JS SDK and then somehow transfer this authorization to my node server (so it can verify requests with the fb graph api) I stumbled across: https://github.com/jaredhanson/passport-facebook/issues/26 & https://github.com/drudge/passport-facebook-token what seems to be an entirely different strategy from passport-facebook. Am I correct when assuming that: One logs in with the fb JS SDK, and then the facebook-token strategy somehow extracts the token and fb id from the document or body object? Or is there any other decent way to

Passport.js: passport-facebook-token strategy, login through JS SDK and THEN authenticate passport?

与世无争的帅哥 提交于 2019-11-28 17:07:46
问题 I was looking for a way to let my client authorize with the facebook JS SDK and then somehow transfer this authorization to my node server (so it can verify requests with the fb graph api) I stumbled across: https://github.com/jaredhanson/passport-facebook/issues/26 & https://github.com/drudge/passport-facebook-token what seems to be an entirely different strategy from passport-facebook. Am I correct when assuming that: One logs in with the fb JS SDK, and then the facebook-token strategy

Passport-facebook doesn't get email [duplicate]

∥☆過路亽.° 提交于 2019-11-28 09:56:24
This question already has an answer here: Passport-Facebook authentication is not providing email for all Facebook accounts 7 answers I have already implemented the Facebook-LogIn in my website with express js and passport-Facebook. It works well (I get field profile), but the problem is that I don't get the Email. I get an error: email : profile.emails[0].value, TypeError: Cannot read property '0' of undefined My code: passport.use('facebook',new FacebookStrategy({ clientID : config.facebook.id, clientSecret : config.facebook.secret, callbackURL : '/auth/facebook/callback', profileFields : [

Get request object in Passport strategy callback

谁说我不能喝 提交于 2019-11-28 07:12:07
So here is my configuration for passport-facebook strategy: passport.use(new FacebookStrategy({ clientID: ".....", clientSecret: ".....", callbackURL: "http://localhost:1337/register/facebook/callback", }, facebookVerificationHandler )); And here is facebookVerificationHandler: var facebookVerificationHandler = function (accessToken, refreshToken, profile, done) { process.nextTick(function () { ....... }); }; Is there a way to access to the request object in facebookVerificationHandler? Users are registered to my site with a LocalStrategy but then they will be able to add their social accounts

Angular/Node/Express/Passport Cross Domain Problems - Enable CORS Passport Facebook Authentication

别说谁变了你拦得住时间么 提交于 2019-11-28 06:50:06
It's been two days and a million tries to enable CORS when trying to authenticate a user with Facebook using Passport in NodeJS/Express. The error I get on Chrome is this: XMLHttpRequest cannot load https://www.facebook.com/dialog/oauth?response_type=code&redirect_uri=http%…%3A8080%2Fauth%2Ffacebook%2Fcallback&scope=email&client_id=598171076960591. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The routes I use are as simple as that: // ===================================== // FACEBOOK ROUTES =======

Passport-Facebook authentication is not providing email for all Facebook accounts

一世执手 提交于 2019-11-28 04:28:58
I am using Passport-Facebook authentication. passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, function (accessToken, refreshToken, profile, done) { process.nextTick(function () { console.log(profile) }); } )); For some of the Facebook accounts I don't get the email_id and I even tried by using a scope variable such as below, but still I am unable to get the email_id. profileUrl : " " and ProfileFields : ['',''] Make sure these two things are in your code: passport.use(new FacebookStrategy({

passport.js with multiple authentication providers?

孤街醉人 提交于 2019-11-28 03:56:09
Using Passport.js is there a way for me to specify multiple authentication providers for the same route? For example (from passport's guide) can I use local and facebook and twitter strategies on the sample route below? app.post('/login', passport.authenticate('local'), /* how can I add other strategies here? */ function(req, res) { // If this function gets called, authentication was successful. // `req.user` contains the authenticated user. res.redirect('/users/' + req.user.username); }); Danilo Ramirez Passport's middleware is built in a way that allows you to use multiple strategies in one

Insecure Login Blocked: You can't get an access token or log in to this app from an insecure page. Try re-loading the page as https://

给你一囗甜甜゛ 提交于 2019-11-27 22:11:29
I am implementing Passport Facebook Authentication by linking the Facebook Authentication API route to a button using href like: <a href="auth/facebook">Facebook Login</a> When I click on the button, it redirects to the Facebook Authentication page. But on the page, an error message is displayed saying something like "Insecure Login Blocked: You can't get an access token or log in to this app from an insecure page. Try re-loading the page as https://" How can I fix this issue? Christopher Amazingly I just started trying to do the same thing like an hour ago and have been having the same issue.

Passport-facebook doesn't get email [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-11-27 05:52:15
问题 This question already has an answer here: Passport-Facebook authentication is not providing email for all Facebook accounts 7 answers I have already implemented the Facebook-LogIn in my website with express js and passport-Facebook. It works well (I get field profile), but the problem is that I don't get the Email. I get an error: email : profile.emails[0].value, TypeError: Cannot read property '0' of undefined My code: passport.use('facebook',new FacebookStrategy({ clientID : config.facebook