Questions tagged passport.js

Explore the latest questions and answers asked by our top developers.

Authentication using linkedin in a mean stack application

so I’ve been trying to implement login with linkedin in my application, and I couldn’t find anything online that could show me the steps from A to Z I implemented the backend and the frontend separateley, however, I don’t know how to link them together In the backend, I’m using passportjs So here’s what I’ve […]

Social Login with Nestjs. Issues with REST API

I’m implementing Google login with Nestjs, Passport and oauth2. Also I’m trying to connect my Nestjs REST API app with an Angular 10 frontend. In my auth.controller.js I have: @UseGuards(AuthGuard(‘google’)) async googleAuth(@Req() req) {} @Get(‘google/redirect’) @UseGuards(AuthGuard(‘google’)) async googleLoginRedirect(@Req() req: Request, @Res() res: Response): Promise<any> { // show current user console.log(req.user); return { statusCode: HttpStatus.OK, payload: […]

passport fails to run with angular global not defined

I am using angular 8 with material. When I install passport using npm i passport then my app fails with run time error as Uncaught ReferenceError: global is not defined at Object../node_modules/node-libs-browser/node_modules/buffer/index.js (vendor.js:278943) at __webpack_require__ (runtime.js:80) at Object../node_modules/safe-buffer/index.js (vendor.js:301667) at __webpack_require__ (runtime.js:80) at Object../node_modules/randombytes/browser.js (vendor.js:286468) at __webpack_require__ (runtime.js:80) at Object../node_modules/crypto-browserify/index.js (vendor.js:223588) at __webpack_require__ (runtime.js:80) at […]

Authentication API in nodejs and angular using passport

I am building a web app using Angular, Express, Node JS, and I am using JSON files as a Database. I want to achieve User login authentication. I want when the user logs in the app using their username and passport, the app fetches the user_ID from the express/passport session according to which the user […]

SAML-Authentication using angular, node.js and an identity provider

I want to to implement SSO using SAML2. But I don’t know how to get it work with a distributed system where each instance is running independently on its own server. The environment consists out of three instances: Instance #1: an angular frontend Instance #2: a node.js backend (using express.js + passport) Instance #3: a […]

By mayerph
Categorized as angular, node.js, passport.js, saml, saml-2.0 Tagged , , , ,

Why is Express creating a new session on each request? Used with Angular

I’ve been trying for few days already… I’ve looked at all other posts but I can’t seem to solve this… I am using passportjs for authentication but the problem is that express-session is creating a new session for each request from Angular. I do use withCredentials in angular isAuthenticated(): boolean{ console.warn(‘inside isauth’); this.http.get<boolean>(‘http://localhost:3000/test’, {withCredentials: true}).subscribe(data […]

By Mario
Categorized as angular, express, passport.js Tagged , ,

Why is deserializeUser not being called? Angular and Express

I’ve already read all the questions related to mine on stack overflow and everywhere else where I could find… I can not solve my problem… I am using Angular and Express… I use withCredentials this is my app.ts file / app.js once compiled import express = require(‘express’); import dotenv = require(‘dotenv’); import router from ‘./routes’; […]

By Mario
Categorized as angular, express, passport.js, typescript Tagged , , ,

Steam OpenID authenticantion with Angular frontend and Express/Passport backend

I’m trying to build an application using Angular 10 in the frond end and Express with Passport using a Steam strategy. I’ve tried adapting this example project, for my use; but there are some problems. What I’ve done is setup angular on port 4200 and express on port 3000, here are the options I […]

Can we remember the user outside a route in passport.js?

I’m creating a MEAN Stack food catalog application. Node.js gives me the user logged in, in my login route when I check for req.isAuthenticated(). But when I try to check later whether I’m still logged in, it gives req.user as undefined. How do I make the user persist? I know I can use local storage […]

nodejs session logout/ destroy without reloading the page

I am using express, express-session and passport in my node.js application and have issues when performing an auto logout. initialization: expressapp.use(session({ secret: ‘****’, cookie: { maxAge: 1000 * 60 * 60 }, // 1h saveUninitialized: false, resave: true })); expressapp.use(passport.initialize()); expressapp.use(passport.session()); my logout code: expressapp.get(‘/profile/’, isLoggedIn, function (req, res) {‘get profile view!’); res.render(‘profile’); }); […]

By Tobi
Categorized as angularjs, express, node.js, passport.js, session
1 2

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us