passport.js

Ask requestVisibleActions permission using Passport.js for moment insertion in Google+ API

谁都会走 提交于 2019-12-23 04:12:18
问题 I'm working on a Node.js application that uses Passport.js for authenticating with Google Plus. In a later stage now, we have introduced of adding activities using Google+'s moment.insert to the user's Google+ feed when they leave reviews at our site. Posting using moment.insert needs a special permission called requestvisibleactions . The passport.js documentation doesn't say how I can ask for such permissions while logging in. My current auth handler setup is like this: app.get('/auth

How do I have two Express sessions?

若如初见. 提交于 2019-12-23 04:08:28
问题 I have a Passport-using application with a GraphQL endpoint and a /logout endpoint. For some reason when I called request.isAuthenticated() from inside the GraphQL endpoint I got back true , but when I made the same exact call from inside the /logout endpoint I got back false . So, I did a bit of logging (of request.session.id ) and it turns out that I somehow wound up with two sessions. Stranger still, the session used by my GraphQL endpoint is persistent: if I restart the server it keeps

How do I have two Express sessions?

假如想象 提交于 2019-12-23 04:08:05
问题 I have a Passport-using application with a GraphQL endpoint and a /logout endpoint. For some reason when I called request.isAuthenticated() from inside the GraphQL endpoint I got back true , but when I made the same exact call from inside the /logout endpoint I got back false . So, I did a bit of logging (of request.session.id ) and it turns out that I somehow wound up with two sessions. Stranger still, the session used by my GraphQL endpoint is persistent: if I restart the server it keeps

passportjs authentication using google apps email id

余生长醉 提交于 2019-12-23 02:53:23
问题 I am trying passport js with google app email id. I am able to authenticate using gmail.com email id. But how can I authenticate if the email id is a google app id (google.com/a/companyname.com). This is my code var express = require('express'); var app = express(); var passport = require('passport'); var GoogleStrategy = require('passport-google').Strategy; passport.use(new GoogleStrategy({ returnURL: 'http://10.3.0.52:3000/auth/google/return', realm: 'http://10.3.0.52:3000/' }, function

passport req.isAuthenticated always return false when using angular $http request

南笙酒味 提交于 2019-12-23 01:42:28
问题 I am using passportjs for my user authentication. By using postman , I can successfully login and req.isAuthenticated always returns me true in the subsequence requests after login. By using angular $http , However, login works ok but the req.isAuthenticated always returns me false in the subsequence request. My angular app(localhost:3000) and the node app(heroku) are at different domain. My thoughts was it may relate to either CORS or session cookie since I do not see any cookies in my

I am trying to use PassportJs with multiple types of users (each one has a different model). What am I doing wrong?

ぃ、小莉子 提交于 2019-12-22 17:55:27
问题 I am trying to use PassportJs with express using multiple types of users (each one has a different model). When I use it with only one type of user it is OK but when I add a second one it is not working. Any idea ? // Configuring Passport var passport = require ('passport'); var LocalStrategyAdmin = require ('passport-local').Strategy; var LocalStrategyClient = require ('passport-local').Strategy; var adminModel = require ('./models/adminModel'); var clientModel = require ('./models

How to configure Passportjs with SQL Server?

自作多情 提交于 2019-12-22 10:54:12
问题 I am writing an app based on SQL Server, ExpressJs, NodeJS, AngularJs, I am an express beginner, I need to handle sessions so I have been thinking on PassportJs, I can't find documentation to integrate SQL Server with PassportJs so I am pretty confused, I have been trying but I don't get it yet, I have built my app with express-generator so this is my app.js Passport requires: var passport = require('passport'); var LocalStrategy = require('passport-local').Strategy; var session = require(

How to avoid the data of request stream loss after doing some authentication on node.js?

谁说胖子不能爱 提交于 2019-12-22 09:15:08
问题 How do request streams works with node.js (express or restify) ? When a client who tries to upload an audio, mpeg or other binary file to the server, the request should be a Readable Stream on the server. that we could pipe into another stream using request.pipe() to for example get the file from the request, and then upload the file to amazon s3 using knox. When I'm using an asynchronous authentication method part of the streamed data is being lost and the length doesn't match with the

Passport AngularJS ExpressJS: Origin null is not allowed by Access-Control-Allow-Origin

我怕爱的太早我们不能终老 提交于 2019-12-22 06:19:21
问题 When I'm trying to use $http module of angular.js for authorizing twitter app I always get: XMLHttpRequest cannot load https://api.twitter.com/oauth/authenticate?oauth_token=something. Origin null is not allowed by Access-Control-Allow-Origin. Client Code: $http({ method: 'GET', headers: { "Content-Type": undefined }, url: '/oauth/twitter' }); Server Code: app.configure(function () { app.use(express.cookieParser()); app.use(express.cookieSession({ secret: 'tobo!', cookie: { maxAge: 3600 }}));

Passport AngularJS ExpressJS: Origin null is not allowed by Access-Control-Allow-Origin

元气小坏坏 提交于 2019-12-22 06:17:08
问题 When I'm trying to use $http module of angular.js for authorizing twitter app I always get: XMLHttpRequest cannot load https://api.twitter.com/oauth/authenticate?oauth_token=something. Origin null is not allowed by Access-Control-Allow-Origin. Client Code: $http({ method: 'GET', headers: { "Content-Type": undefined }, url: '/oauth/twitter' }); Server Code: app.configure(function () { app.use(express.cookieParser()); app.use(express.cookieSession({ secret: 'tobo!', cookie: { maxAge: 3600 }}));