passport-facebook

Unknown Authentication Facebook Strategy - PassportJS

烂漫一生 提交于 2019-12-11 07:32:46
问题 I've a issue with PassportJS. It displays this message and I can't understand where I'm doing wrong: {"message":"Unknown authentication strategy \"facebook\"","error":{}} GET /auth/facebook 500 0.505 ms - 69 Credentials are hardcoded for simplicity and learning purpose. Passport and Passport-Facebook are installed. auth/index.js var passport = require('passport'); var FacebookStrategy = require('passport-facebook').Strategy; var User = require('../modules/user'); module.exports = function(){

{ [FacebookTokenError: This authorization code has been used.]

依然范特西╮ 提交于 2019-12-10 10:24:50
问题 I have a sails app. I was trying to implement Facebook Login. When I click on the Login with facebook button i am getting this error: error: A server error occurred in a request: error: FacebookTokenError: This authorization code has been used. Full error log looks like this: error: A server error occurred in a request: error: FacebookTokenError: This authorization code has been used. at Strategy.parseErrorResponse (/home/node_modules/passport-facebook/lib/strategy.js:198:12) at Strategy

how to send json as a response after passport authenticationin node.js

こ雲淡風輕ζ 提交于 2019-12-09 17:10:20
问题 I am trying this git example. Which works well when I integrated it with my project, but what I want to achieve is to send json as a response to the client/request, instead of successRedirect : '/profile' & failureRedirect : '/signup'. Is it possible to send a json, or is there some other methods to get the same? Any help will be appreciated,TU 回答1: You can use passport's authenticate function as route middleware in your express application. app.post('/login', passport.authenticate('local'),

email field is optional in passportjs facebook strategy

佐手、 提交于 2019-12-08 00:04:11
问题 I wrote the code for login with facebook, everything works and I'm getting the user's email address. But there is another option on facebook which lets the user select the data my application is going to have access to. If user clicks on that, he'll see the name and everything marked as required, but email is optional and the user can remove it from the data that is going to be provided to the app. On the application, email is required. So how I can mark the email as required on facebook?

email field is optional in passportjs facebook strategy

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 04:29:46
I wrote the code for login with facebook, everything works and I'm getting the user's email address. But there is another option on facebook which lets the user select the data my application is going to have access to. If user clicks on that, he'll see the name and everything marked as required, but email is optional and the user can remove it from the data that is going to be provided to the app. On the application, email is required. So how I can mark the email as required on facebook? This is the snippet I'm using in the code. passport.use(new FacebookStrategy({ clientID: config.social

Oauth2 flow without redirect_uri

纵然是瞬间 提交于 2019-12-05 22:19:17
问题 I am creating an Android/iOS app which communicates with a Node.js server and would like to identify them securely on my server using Google (and/or Facebook) and OAuth2. I've looked at the following documentation: https://developers.google.com/+/web/signin/server-side-flow I do not need authorization, I only need authentication (I only want to make sure that the person calling my Node.js service is the person they say they are). To achieve this, if I understand properly, I have to let the

{ [FacebookTokenError: This authorization code has been used.]

烂漫一生 提交于 2019-12-05 19:12:13
I have a sails app. I was trying to implement Facebook Login. When I click on the Login with facebook button i am getting this error: error: A server error occurred in a request: error: FacebookTokenError: This authorization code has been used. Full error log looks like this: error: A server error occurred in a request: error: FacebookTokenError: This authorization code has been used. at Strategy.parseErrorResponse (/home/node_modules/passport-facebook/lib/strategy.js:198:12) at Strategy.OAuth2Strategy._createOAuthError (/home/node_modules/passport-facebook/node_modules/passport-oauth2/lib

Retrieving photo from Facebook using passport-facebook

杀马特。学长 韩版系。学妹 提交于 2019-12-04 17:17:18
问题 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", "user_birthday", "read_friendlists"]})); app.get("/auth/facebook/callback", passport.authenticate("facebook",{ successRedirect: '/', failureRedirect: '/'})); var mongoose = require('mongoose'), FacebookStrategy = require('passport-facebook')

how to send json as a response after passport authenticationin node.js

喜夏-厌秋 提交于 2019-12-04 06:45:08
I am trying this git example . Which works well when I integrated it with my project, but what I want to achieve is to send json as a response to the client/request, instead of successRedirect : '/profile' & failureRedirect : '/signup'. Is it possible to send a json, or is there some other methods to get the same? Any help will be appreciated,TU You can use passport's authenticate function as route middleware in your express application. app.post('/login', passport.authenticate('local'), function(req, res) { // If this function gets called, authentication was successful. // `req.user` contains

Oauth2 flow without redirect_uri

别说谁变了你拦得住时间么 提交于 2019-12-04 06:14:45
I am creating an Android/iOS app which communicates with a Node.js server and would like to identify them securely on my server using Google (and/or Facebook) and OAuth2. I've looked at the following documentation: https://developers.google.com/+/web/signin/server-side-flow I do not need authorization, I only need authentication (I only want to make sure that the person calling my Node.js service is the person they say they are). To achieve this, if I understand properly, I have to let the user log in using Google on the client side, this will give them an authorization_code which they can