How can I report an invalid login properly with Express and PassportJS?
Problem
I've successfully implemented passport-local into my Express/Mongoose web-app but I'm having trouble figuring… Read More
Using PassportJS with Connect for NodeJS to authenticate Facebook Users
Problem
I'm trying to integrate passport into my nodejs server using connect, but can't seem to do it properly. All t… Read More
PassportJS: How to get req.user in my views
Problem
I am using pssportjs with express 2.x and a sessions storage. After a login I am getting req.User only once. As soon as I redirect again… Read More
Using PassportJS, how does one pass additional form fields to the local authentication strategy?
Problem
I'm using passportJS and I'm wanting to supply more than just req.body.username and… Read More
authentication using node.js and mongoose and expressjs and passportjs
Problem
Guys where can I get an example of authentication using node js and mongodb and passportjs using the username… Read More
expressjs + mongoose + passportjs GithubStrategy
Problem
I'm trying to save a user that authenticated through GitHub into mongodb. I'm using mongoose. Below is what I have:
var accountSche… Read More
passportjs and passportlocal add users "Error: failed to serialize user into session"
Problem
I have followed the code here - > https://github.com/jaredhanson/passport-local/tree/master/… Read More
PassportJS and ExpressJS conditional URL redirect
Problem
I am using ExpressJS and PassportJS's Facebook strategy to try and perform some conditional redirects on the authentication callbac… Read More
Storing sessions with passportjs, Express and monogodb
Problem
I'm having trouble getting sessions with mongodb to work properly. I've setup the following code which, without a problem, cre… Read More
PassportJS - how to get session object
Problem
I have implemented passportJS in my node application. After logging in I get an object which I place in the session. This is the object:
{ lo… Read More
PassportJs, local strategy cannot be found
Problem
I am new to javascript and node. I followed the guide from passportJS and I am getting the error "local strategy cannot be found". I do no… Read More
passportjs authentication using google apps email id
Problem
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… Read More
Need to redirect to google app email login page instead of normal gmail login in passportjs and nodejs
Problem
I have a nodejs application. In which I setup a google auth2 login system usin… Read More
Unable to get simple passportjs with mongoose working
Problem
I am using passport-local-mongoose and trying to setup a simple working example using the login example in the repository. But… Read More
Cannot verify access_token to PassportJS in iOS Facebook SDK
Problem
I am trying to use Facebook iOS sdk with PassportJS (sever is NodeJS)
I sucessfully managed to log in with Facebook on m… Read More
passportjs error callback throwing exception
Problem
I'm using LocalStrategy with MYSQL(with sequelize) which is working except when MYSQL throws exception (just to test, I shut down MYSQL… Read More
Authentication using Facebook with Passportjs: what is accessToken for, what should I store after registration?
Problem
I am using Passport to register/authenticate using Facebook.
When oAu… Read More
NodeJS ExpressJS PassportJS - for Admin Pages Only
Problem
Im using NodeJS, ExpressJS, Mongoose, passportJS & connect-ensure-login. Authenticating users works perfectly.
....
var passp… Read More
How to do asynchronous authentication in Node.js + MongoDB + PassportJS app
Problem
I'm using Node.js, MongoDB, and PassportJS and I'm trying to authenticate using the local strategy (just… Read More
Only allow passportjs authenticated users to visit protected page
Problem
Is placing this code inside of a route enough to protect pages from unauthenticated users?
if (!req.user) return r… Read More
Get IP in PassportJS / ExpressJS
Problem
I'm using PassportJS in an ExpressJS web app.
In app.js:
//passportjs google
passport.use(new GoogleStrategy({
clientID: '...',
clientSecr… Read More
Using PassportJS google authentication with the nodejs google api library
Problem
I'm currently looking at implementing a google api, using the nodejs client:
https://github.com/google/goo… Read More
passportjs facebook pass request to callback
Problem
I must be overlooking something here. I'm using the Facebook strategy of passportjs to authenticate users. This is done with 2 requests/… Read More
How to set the session timeout after log in passportjs?
Problem
I want to set a session timeout after log in using passportjs. How to set the maxAge for the session using passportjs. What i… Read More
PassportJS, ExpressJS, NodeJS, Creating API w/ Authentication
Problem
Im using PassportJS in ExpressJS application:
In app.js, I have route for admin-only and requiresAdmin function:
var… Read More
PassportJS with express (nodejs) upload form
Problem
I want to make a upload form. This part is done and it work... but now I want to put the same security authentification that I have alre… Read More
Create a facebook login session with passportjs using existing access key?
Problem
tl;dr: Is there any way to create a facebook login session with passportjs using existing access key?
I'm… Read More
Passportjs - How do I request a user's image using the Google strategy?
Problem
How can I configure my Google API access to request a user's image while authenticating? Currently 'profile'… Read More
PassportJS req.user sending all user data
Problem
I'm using PassportJS local strategy for user authentication, its working totally fine on.
However when I try to console.log(req.user) on an… Read More
Passportjs documentation - meaning of function
Problem
On this Passportjs.org page, the documentation gives an example of using a LocalStrategy, and within the LocalStrategy, it calls a fun… Read More
How to get a new Google oauth access token from refresh token in passportjs
Problem
there seems to be some conflicting advice on how to get an access token from a refresh token:
This SO an… Read More
Passportjs - req.logout function does not exist
Problem
I have a route that looks like so:
exports.logout = function(res, req){
req.logout() // I blow up
res.redirect('/')… Read More
PassportJS in Nodejs never call the callback function
Problem
I am trying to authenticate the yammer user using Passport.
It can get through yammer authentication page and I can click to a… Read More
Get an oauth access token from refresh token in passportjs
Problem
To determine when to use a refresh token to ask for a new access token, I'm aware of two approaches (below). Are either of… Read More
PassportJS - login credentials in GET request?
Problem
I'm working on a RESTful web application. I would like to have user registration occur via a POST request (username and password in th… Read More
How does the client side know if it is logged in (passportjs and express on server)?
Problem
I'm using passportjs on my server for authentication, and I'm wondering if any value gets set on… Read More
Use multiple local strategies in PassportJS
Problem
I'm trying to use multiple LOCAL strategies with PassportJS. I'm not trying to use local, facebook, and gmail, etc.
I have two sets of us… Read More
PassportJS Custom Authenticate Callback Not Called
Problem
Update: The below error was fixed by a commit. I've marked the first answer as 'correct', though the commit was brought to my atte… Read More
Passportjs BearerStrategy vs. OAuth2Strategy
Problem
I'm trying to make a oauth2 client against a custom oauth2 provider using passportjs to authenticate. There's 2 strategy in passportjs t… Read More
How to fix passportjs logout sessions ?
Problem
In Passportjs, in order to logout after login and using google accounts I'm using this:
app.get('/logout', function(req, res){
req.logou… Read More
PassportJS (Google OpenID) nothing in req.user
Problem
According to the PassportJS docs
If authentication succeeds, the next handler will be invoked and the req.user property will be se… Read More
How to handle PassportJS endpoint errors
Problem
If I visit the Facebook callback link at http://localhost/login?code=***
with a bogus code: FacebookTokenError: Invalid verification code… Read More
Error when using MongoStore with Express
Problem
I'm trying to store the sessions of my Express app in a MongoStore but I get an error at the connection. The error is a huge Object/JSON tha… Read More
passport.js and process.nextTick in strategy
Problem
I'm facing something new in nodeJS: process.nextTick
In some strategies code examples for passport.js, we can see
passport.use(new Loc… Read More
PassportJS callback switch between http and https
Problem
Right now, when I visit my page at https://example.com and click login, it goes to https://example.com/auth/facebook, which then do… Read More
Express.js Passportjs and unauthorized user
Problem
Ok, I've been looking into this for a couple of days and I really don't know what the problem is. For some reason, the authentication fai… Read More
How to differentiate Login from Sign up when using PassportJS for Facebook
Problem
I am trying to set up goals on Google Analytics to track Sign Ups, so I set up a 'thank you ' page as my u… Read More
GET and handle data from DB with node.js express
Problem
I'm creating a jQuery mobile app and I've a linux server with node.js and express. I think the authentification works fine and the d… Read More
Typescript for passportjs
Problem
I'm very new to typescript. The idea sounds great and so I want to give it a try and port existing javascript code to typescript. The project I want to por… Read More
Passportjs local strategy is not running
Problem
I am developing a node.js app and have included the use of passportjs for authentication.
But for some reason the login is not firing the l… Read More
req object in passport.authenticate
Problem
I am using passportjs for authentication on my server. I am using the following code:
exports.auth = function(req, res, next){
passport.authen… Read More
Angularjs, Expressjs and passportjs for authentication checks on server side
Problem
I have a Node.js application where I have used Yeoman scaffolding for Angular. I am also using ExpressJS… Read More
Change view based on user role with MEAN + Passport
Problem
I'm setting up an authentication scheme with the MEAN stack and PassportJS to authenticate a user via an OpenID provider. When a… Read More
Why isn't my AngularJS/Express/Socket.io app serving the socket.io.js file?
Problem
I have an Angular/NodeJS app, with Socket.io support added in for some real-time features.
I wanted to a… Read More
Prevent Expressjs from creating a session when requests contain an authorization header?
Problem
I have an API that can be called either using a browser where requests are transactional and… Read More
Most modern applications require individuals to verify their identity. Authentication is the process of verifying the identity of an individual. A user can interact with a web application u… Read More
What do you believe SaaS can do for your business? Google Cloud, Microsoft Cloud, AWS Cloud, Enterprise Cloud – there’s a lot to explore!
It’s almost 2023, so we assume you… Read More
What is Full-Stack Web Development?Full-Stack web development implies knowledge of all parties responsible for the front-end and back-end of a web application. Full-stack web developers are… Read More