Questions tagged [passport-facebook]

Passport strategy for authenticating with Facebook using the OAuth 2.0 API. Lets you authenticate using Facebook in your Node.js applications

296 questions
64
votes
1 answer

passport.js with multiple authentication providers?

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', …
cgiacomi
  • 4,629
  • 6
  • 27
  • 33
56
votes
7 answers

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

I am using Passport-Facebook authentication. passport.use(new FacebookStrategy({ clientID: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET', callbackURL: "http://www.example.com/auth/facebook/callback" }, …
AMT
  • 701
  • 2
  • 6
  • 7
48
votes
3 answers

Get request object in Passport strategy callback

So here is my configuration for passport-facebook strategy: passport.use(new FacebookStrategy({ clientID: ".....", clientSecret: ".....", callbackURL: "http://localhost:1337/register/facebook/callback", }, …
Élodie Petit
  • 5,774
  • 6
  • 50
  • 88
33
votes
3 answers

Facebook-passport with JWT

I've been using Passport on my server for user authentication. When a user is signing in locally (using a username and password), the server sends them a JWT which is stored in localstorage, and is sent back to server for every api call that…
Bar Kedem
  • 575
  • 1
  • 6
  • 13
26
votes
3 answers

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

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…
Larissa Leite
  • 1,358
  • 3
  • 21
  • 36
24
votes
4 answers

How to provide frontend with JSON web token after server authentication?

So far I have only dealt with server-rendered apps, where after a user logs in via username/password or using an OAuth provider (Facebook etc.), the server just sets a session cookie while redirecting to the relevant page. However now I'm attempting…
Inkling
  • 3,544
  • 4
  • 30
  • 44
24
votes
1 answer

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

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…
23
votes
9 answers

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://

I am implementing Passport Facebook Authentication by linking the Facebook Authentication API route to a button using href like: Facebook Login When I click on the button, it redirects to the Facebook Authentication…
17
votes
5 answers

Retrieving photo from Facebook using passport-facebook

I am able to retrieve basic user information via passport-facebook, following the below code and saving in mongodb: app.get("/auth/facebook", passport.authenticate("facebook", { scope : ["email", "publish_stream", "user_location", "user_hometown",…
user2897777
  • 273
  • 1
  • 4
  • 10
15
votes
1 answer

PassportJS Session Mixed Up

On our ExpressJS application, when pushed to production server, the passport session gets mixed up at random times. At random, the page can load the view of another user even when I did not log out of my session. Without doing anything else, another…
mauris
  • 42,982
  • 15
  • 99
  • 131
14
votes
3 answers

Passport-facebook doesn't get email

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:…
jcabello
  • 287
  • 3
  • 8
11
votes
2 answers

facebook-passport with NestJS

I have looked into both passport-facebook and passport-facebook-token integration with NestJS. The problem is that NestJS abstracts passport implementation with its own utilities such as AuthGuard. Because of this, ExpressJS style implementation…
randombits
  • 47,058
  • 76
  • 251
  • 433
10
votes
2 answers

What's the best way to mix passport-facebook and passport-jwt?

I am kind of new to Node.js development and currently working on a pet project on my free time. So far I have created JWT authentication using passport and passport-jwt for the strategy and I am using it in all of my RESTful APIs. Now I am thinking…
Tohid
  • 21,535
  • 8
  • 30
  • 43
10
votes
1 answer

What is the right way to do facebook login for mobile app (with node.js/passport.js server)

I have a mobile app that is working with the backend server, I would like to understand what are the best practices for using facebook to login (create an account) and then to maintain the whole system in sync. Here is what I understand so far: -…
Dmitry Fink
  • 1,032
  • 1
  • 13
  • 31
9
votes
1 answer

how to handle passport-facebook callback in angular client?

I am developing a MEAN application. I am using passport for authentication- local, facebook and google strategies. I am using angularjs client. All the routing is handled at client. I am only consuming server data apis. When using passport-facebook…
mjaydip
  • 143
  • 1
  • 8
1
2 3
19 20