passport-facebook

Facebook-passport with JWT

放肆的年华 提交于 2020-07-31 07:50:26
问题 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 requires user authentication. Now I want to support Facebook and Google login as well. Since I began with Passport I thought it would be best to continue with Passport strategies, using passport-facebook and passport-google-oauth . I'll refer to Facebook,

How to catch FacebookAuthorizationError in passport-facebook / Passport.js?

前提是你 提交于 2020-03-04 23:29:38
问题 I have an express app that uses Facebook authentication via Passport.js and the passport-facebook strategy. I have followed the documentation on how to handle authentication. It all works fine... until Facebook tries to report an error via the callback Url. In this case, I get an uncaught FacebookAuthorizationError exception, and the failureRedirect is not called. End users see an "Internal Server Error" as a result of the un-caught exception and I am in non-compliance with Facebook

How to catch FacebookAuthorizationError in passport-facebook / Passport.js?

不羁的心 提交于 2020-03-04 23:28:19
问题 I have an express app that uses Facebook authentication via Passport.js and the passport-facebook strategy. I have followed the documentation on how to handle authentication. It all works fine... until Facebook tries to report an error via the callback Url. In this case, I get an uncaught FacebookAuthorizationError exception, and the failureRedirect is not called. End users see an "Internal Server Error" as a result of the un-caught exception and I am in non-compliance with Facebook

passport don't redirect to 'failureRedirect' upon failure with facebook

微笑、不失礼 提交于 2020-03-02 09:08:21
问题 Im using passport to authenticate a user through Facebook. The successRedirect works great [I'm redirecting into http://localhost:3000/success#_=_ ], but the failureRedirect doesn't, i'm getting this: FacebookAuthorizationError: Login Error: There is an error in logging you into this application. Please try again later. [I'm getting this in my browser-> http://localhost:3000/auth/facebook/callback?error_code=1349003&error_message=Login+Error%3A+There+is+an+error+in+logging+you+into+this

ExpressJs Passportjs de-serializes user object for every request to a route

Deadly 提交于 2020-01-06 03:30:28
问题 I have a ExpressJS app that is using Passportjs to authenticate with Facebook and everything is working as expected exception for one issue. I have vehicle.js under /routes/ which contains some routes (router.gets and router.posts) that need authentication and some that don't. If user is logged in then every request handled by vehicle.js causes User de-serialization which is a Mongoose lookup. How can I avoid these unnecessary Mongoose lookups when request is made to a router.get and/or

Passport facebook authentication not working

狂风中的少年 提交于 2020-01-05 09:35:24
问题 I have a nodeJS application (express), which has a facebook login. I'm using the passport-facebook authentication, described in here passport-facebook. My login was still working couple weeks ago ok, but now something has changed. I'm not sure if Facebook has changed something, or if I have. I haven't touched to any of the login code, so I suspect it is something in the facebook's end. Here is my authentication code: router.get('/', passport.authenticate('facebook'), function(req, res){ });

How to use Facebook Graph API after authenticating with Passport.js facebook strategy?

那年仲夏 提交于 2020-01-05 04:22:08
问题 I've authenticated my user with the Facebook strategy and obtained their user info. My application now needs to hit other graph api endpoints on Facebook. I don't see a way to access a tool to send requests to the Facebook graph api. Upon inspecting the Strategy a little further, I see everything is built around the OAuth 2 strategy. 1) How do I use the facebook strategy to call other graph api endpoints? 2) Am I supposed to drill into the passport api somewhere to access a related oauth

Passport Facebook integration with angular-fullstack app not saving user session in angular-fullstack structure

£可爱£侵袭症+ 提交于 2020-01-04 09:02:44
问题 I have an angular-fullstack app generated from here - https://github.com/angular-fullstack/generator-angular-fullstack I am using the same directory structure as angular-fullstack. Now I am trying to authenticate users with facebook sdk and did the following steps - 1) specify passport facebook login strategy // created auth/facebook/index.js 'use strict'; var express = require('express'); var passport = require('passport'); var auth = require('../auth.service'); var router = express.Router()

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

孤人 提交于 2020-01-01 02:24:29
问题 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 to build an app using a more 'modern' approach, with React on the frontend and a JSON API backend. Apparently the standard choice for this is to use a JSON web token for authentication, however I'm having trouble working out how I'm meant to

Passport-Facebook giving two different facebook Id

无人久伴 提交于 2019-12-24 11:27:30
问题 I tried to implement facebook OAUTH for my applications(Web and Mobile) using Sails.js/Node.js and Mongo as my backend. I wrote a dedicated function to access the endpoints for each app cause the webApp needs a callback URL and the mobile doesn't. My code screenshot is available below. But, I noticed the two gives me two different Facebook id. I am confused, shouldn't the facebookId be unique? I am using these two modules FacebookStrategy = require('passport-facebook').Strategy