passport.js

Account Linking Alexa with Twitter - Amazon Echo

情到浓时终转凉″ 提交于 2019-12-19 11:04:35
问题 As of now I cannot seem to get my Alexa skill linked with twitter. Currently, I have a node/express server running on EBS which, I am using passport-twitter to handle the oauth part of the authentication. Right now my flow is such: Enable skill in Alexa app Click 'sign in to account' in alexa app Twitter Login screen is displayed and I enter user name and password then click Login button get redirected to Amazon provided url for callback once authenticated and get an 'Unable to link you skill

Account Linking Alexa with Twitter - Amazon Echo

烂漫一生 提交于 2019-12-19 11:04:06
问题 As of now I cannot seem to get my Alexa skill linked with twitter. Currently, I have a node/express server running on EBS which, I am using passport-twitter to handle the oauth part of the authentication. Right now my flow is such: Enable skill in Alexa app Click 'sign in to account' in alexa app Twitter Login screen is displayed and I enter user name and password then click Login button get redirected to Amazon provided url for callback once authenticated and get an 'Unable to link you skill

Opening password protected site (Passport.js) with Phantom.Js by setting cookie

こ雲淡風輕ζ 提交于 2019-12-19 10:53:22
问题 I am trying to access a passport protected page of my Express.js app with a Phantom.js script. How can I simulate a logged in user without knowing the passport? I am using Passport.js as a auth library with LocalStrategy and MongoStore to safe the sessions in the mongo database. I am wondering if I can create a record in the sessions collection and set a generated cookie with Phantom.js ( phantom.addCookie(...) ) to simulate a specific logged in user without the password of the user? Can I

How to pass a third argument to a callback using Bluebird.js nodeify

允我心安 提交于 2019-12-19 09:51:12
问题 With a little help I've arrived at the following code to promisify a passport.js login strategy. var passport = require('passport'); var LocalStrategy = require('passport-local').Strategy; var Promise = require('bluebird'); var bcrypt = require('bcrypt'); var db = require('./db').db; //users are stored in mongo //I'm using bluebird.js for promises var users = Promise.promisifyAll(db.users); var compare = Promise.promisify(bcrypt.compare); // This strategy is used by passport to handle logins

Anyway to set proxy setting in passportjs?

百般思念 提交于 2019-12-19 05:45:07
问题 Currently, I am using sails framework which is based on expressjs and using passportjs(http://passportjs.org/) to do yammer authentication. I have problem when deploying my node app on server which is behind the company proxy. It cannot connect to yammer for OAuth2 authentication. The error is as follow: error: failed to obtain access token (Error: connect ETIMEDOUT) at /root/rlps/node_modules/passport-yammer/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth2.js:125:38 at /root

Passport authentication not working in sails.js application

℡╲_俬逩灬. 提交于 2019-12-18 21:26:33
问题 I have a Sails JS application. I am trying to setup authentication using Passport.js authentication layer sails-generate-auth. I have configured my app by following the steps given in their documentation. But when I lift my sails app, authentication is not working. I am able to access the controllers, even when I am not logged in (It's not redirecting to my login page). I added a console.log statement in api/policies/passport.js as follows: module.exports = function (req, res, next) {

Adding extra information in user object in passport.js or somewhere in session

元气小坏坏 提交于 2019-12-18 14:47:32
问题 I want to add custom keys in the user object that is coming from mongodb and that is going to be used by passport.js but i wonder why i can't add more keys to that object, here is my code. passport.use(new LocalStrategy( function(username, password, done) { Users.model(false).findOne( {email:username,password:encodePassword(password) }, function(err, user) { if( err ){ // validation failed console.log('Error Occurred'); return done(err); } else if(user != null){ user['customKey'] =

Update logged in user details in session

瘦欲@ 提交于 2019-12-18 14:15:19
问题 I am using PassportJS with ExpressJS. I need to update the logged in user details. While I do update this in the DB, how do I update it in the session too so that request.user contains the updated user details? That is, after updating the database, how do I update the session info on the user as well? I tried directly assigning the updated details to request.user but it did not work. I then tried request.session.passport.user - this worked but there is a delay of around 5 to 10 seconds before

Express Passport.js: req.user VERSUS req.session.passport.user

柔情痞子 提交于 2019-12-18 12:23:16
问题 As per this article http://toon.io/understanding-passportjs-authentication-flow/ it looks as though PassportJS/Express store the logged in user in two places req.user and req.session.passport.user why both? which one should I use? When I logout with passport, does it destroy both req.user and req.session.passport.user? 回答1: You should always, always use req.user in your own code -- this is important because if you use req.session.passport.user , you're essentially pulling user information out

passport google oauth on localhost

拟墨画扇 提交于 2019-12-18 12:17:00
问题 I am quite new at using passport for authentication over node, hence the lot of code snippets my server is configured as : var router = require('./app/config/routes'); var googleStrategy = require('./app/config/passport'); var session = require("express-session"); var passport = require('passport'); app.use(session({secret : '<secret-key>'})); app.use(passport.initialize()); app.use(passport.session()); googleStrategy(passport); my routes are configured as module.exports = function(app,