Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Passport JWT Unauthorized in node js and angular

I am using passport jwt with node and Angular. it is throwing unauthorized error. I have tried with many solution on other stackoverflow questions but nothing works. I am using sequalize with MySQL ...
Prasad Gavande's user avatar
0 votes
0 answers
13 views

keepSessionInfo for passport.js not working for versions 0.7-0.6?

Any calls made to my passport.authenticate() middleware deletes and recreates my req.session object. I need it to stay consistent because it's shared with my socket.io connection. After some digging I'...
chron1cle's user avatar
0 votes
0 answers
30 views

How to Update Google OAuth2 Integration for Social Login After Google’s Policy Changes?

I was previously using passport-google-oauth20 in my Node.js application to handle Google social login. Here's a snippet of my implementation: const login_passport = require('passport'); const ...
khem K's user avatar
  • 9
1 vote
0 answers
44 views

Fastify Passport LocalStrategy: Error 'Expected a string or Buffer' when accessing protected route

I'm implementing a Fastify authentication system using @fastify/passport with a LocalStrategy. Below is the auth plugin that handles user serialization, deserialization, and the local strategy ...
semnmrr's user avatar
  • 11
0 votes
0 answers
11 views

Session expiring when redirecting users to account linking

I’m using Express.js with Passport.js for user authentication and Whoop OAuth integration. My session is being lost when I visit the /auth/whoop route, which initiates the OAuth flow. After ...
FlamingHotDog's user avatar
0 votes
0 answers
38 views

axios bad request debug 404

I am working on setting up a login system with both a frontend and a backend. I'm encountering an error and want to understand it more clearly. What steps can I take to debug this? My folder structure ...
Pooh_Jr's user avatar
0 votes
0 answers
22 views

Why does installing @types/passport-google-oauth20 cause type conflicts with my custom Request interface in Express?

I am working on an Express application where I need to extend the Request interface to include custom properties for user and admin. Here's my custom interface: This setup worked fine until I ...
Aswin Ambalathara's user avatar
0 votes
1 answer
47 views

req.user is undefined in passport.js/express/mongodb application

I have implemented a basic passport.js authentication on top of an expressJS/node application. The user auth is working fine, but I would like to be able to store specific additional data for each ...
James Johnson's user avatar
0 votes
2 answers
61 views

OAuth2 Validating tokens on backend when using multiple providers

I'm quite new to using OAuth2 and was wondering how do you validate access tokens that multiple providers? I have a front end server that is allowing authentication from multiple provides (e.g, Google,...
Brian Michael Berrelez's user avatar
0 votes
1 answer
34 views

How to pass data to multiple database tables in NodeJS using google OAuth?

passport.use("google", new GoogleStrategy( { clientID: process.env.GOOGLE_CLIENT_ID, clientSecret: process.env.GOOGLE_CLIENT_SECRET, callbackURL: "http://...
Yasas Lekamge's user avatar
0 votes
0 answers
37 views

passport.authenticate is not working - LinkedIn OAuth

I have been trying to implement linked OAuth with passport.js, but I keep getting the message the application is disabled I have rechecked the code multiple times but can't find anything wrong with ...
Margaret Maina's user avatar
0 votes
0 answers
29 views

Handling Incorrect Password or Username in Passport-ActiveDirectory Validate Function

I am creating a REST API using Nestjs and as part of authentication i needed to authenticate a user against my company active directory, I was able to use `passport-activedirectory' strategy to ...
Abdulbasit Yusuf's user avatar
0 votes
0 answers
25 views

Can't delete an user session from Prisma database in a Node.js back-end through a react front-end

I have a back-end function to logout and delete session in Prisma database. const logout = (req, res, next) => { req.logout((err) => { if (err) { return next(err); } req....
João Vitor de Oliveira's user avatar
0 votes
0 answers
42 views

"failed to fetch user profile" Error While Authenticating LinkedIn in Passport JS OAuth2

I'm having following error while authenticating LinkedIn in Passport JS. { "message": "LinkedIn authentication failed", "error": "failed to fetch user profile" }...
Fuaad's user avatar
  • 440
0 votes
0 answers
26 views

"Unknown scope "r_email"" Error While Authenticating LinkedIn in Passport JS OAuth2

I'm having following error while authenticating LinkedIn in Passport JS. {"message":"LinkedIn authentication failed","error": "Scope "r_emailaddress&...
Fuaad's user avatar
  • 440
0 votes
1 answer
237 views

Implementing Microsoft SSO with passport-azure-ad and without msal

I want to implement SSO sign up/sign in for Microsoft Azure AD B2C in NodeJS however, I want to create the user using Graph API. I'm using passport-azure-ad strategy. The process has to be custom ...
Scripter9700's user avatar
0 votes
1 answer
52 views

Error: Unknown authentication strategy "google" in Passport.js OAuth Setup

I'm trying to implement Google OAuth in my Node.js application using Passport.js, but I keep getting the following error when accessing the /auth/google route: Error: Unknown authentication strategy &...
Krishnadev. V's user avatar
0 votes
0 answers
37 views

Mocking passport.authenticate behaves inconsistently between tests in Jest

I am trying to test an Express.js route in a Node.js application using Jest, where I mock passport.authenticate. Each test requires a different mock implementation of passport.authenticate, but the ...
Smit Patel's user avatar
0 votes
0 answers
107 views

How to Use Google OAuth Access Token to Open an Authenticated Google Maps Session Using Playwright

I am working on a Node.js application that uses Playwright to automate interactions with Google Maps. The goal is to use a previously obtained Google OAuth access_token and id_token to open a browser ...
Messaoud Med Yassine's user avatar
0 votes
0 answers
14 views

Terminal Showing a Prisma Error In PERN App

Error Argument `user` is missing. set(): PrismaClientValidationError: Invalid `this.prisma[this.sessionModelName].create()` invocation in /home/muhammed/Desktop/cloud-nest/cloud-nest/node_modules/@...
Mhmd's user avatar
  • 11
0 votes
1 answer
24 views

Node.js not persisting redirect URL in session variable set in middleware

app.js const express = require('express'); const chalk = require('chalk'); const app = express(); const debug = require('debug')('app') const path = require('path'); const morgan = require('morgan'); ...
Yoosaf Abdulla's user avatar
0 votes
0 answers
35 views

getting 403 forbbiden error for linkedIN oauth 2.0

My react code import React, { useState, useEffect } from 'react'; import axios from 'axios'; import 'bootstrap/dist/css/bootstrap.min.css'; function App() { const [profile, setProfile] = useState(...
Prashant Jani's user avatar
0 votes
1 answer
27 views

passport js google getting original request param in callback

I'm attempting to get a url param /api/sso-login/google?mobile=true in the callback function. However the req returned is for the google auth and not the original request to the server. I have ...
Callum's user avatar
  • 13
0 votes
0 answers
29 views

Can't set cookies with passport google oauth

I am using Passport's GoogleAuth2.0 to login. I can login successfully but in callback function can't set any cookies. This is my callback function after authentication : exports.googleCallback = (req,...
Yunus Emre Tosun's user avatar
-2 votes
1 answer
80 views

passportjs + googleoauth20 + express-session (valkey store optional) req.user undefined

I'm so tired i spent the whole day trying to fix it but no matter what i do it's not working all i get is undefined PLEASE PLEASE HELP!!!! The Problem is that I'm getting req.user property as ...
Parag Yadav's user avatar
-1 votes
1 answer
63 views

Is this a valid approach to password reset [closed]

I'm currently building a password reset flow and wanted to check this made sense. So the user would make a request passing their email which would generate a token, this would be sent to the user and ...
Ed Lynch's user avatar
  • 623
1 vote
1 answer
35 views

Passport JS authenticates if the user goes back on navigation history even without selecting account

When the user have logged In the app before(gave consent), in the next time while logging in the user can be authenticate without even selecting the account. How to prevent it? Bug occurs on step 2: ...
Shane O Neil's user avatar
1 vote
1 answer
99 views

NestJS multitenancy with Passport JWT not working, Request object is undefined

I have created a multitenant app in NestJs using a connection factory where we inject a connection for each request. I have spent several days debugging this but no luck till now. Github repository: ...
Edison Biba's user avatar
  • 4,443
2 votes
0 answers
66 views

OAuth working on localhost and production in Chrome, but not Firefox / Safari

I am quite new to web development, so please bear with me! I have deployed a React application (famtivity.fun) via Netlify with my backend hosted on Heroku (here). Initially, Oauth for Google / Github ...
Lindsay Renna's user avatar
1 vote
0 answers
17 views

How to implement login and registration module in node and react with passportjs

I want to know like there is a three pages login registration and home now I want like before signup or sign in user should not be able to access home page now how to implement that like normally and ...
techguy's user avatar
  • 11
0 votes
1 answer
39 views

passport.deserializeUser function never getting called

Passport's deserialization just does not work no matter what I do. This is my passport.js: const passport = require('passport'); const GoogleStrategy = require('passport-google-oauth20').Strategy; ...
hypedstan's user avatar
0 votes
0 answers
39 views

NPM passport issue

I am using NPM package passport router.get("/login", (req, res) => { res.render("users/login.ejs"); }); router.post( "/login", (req, res) => { ...
Sparsh Maheshwari's user avatar
0 votes
1 answer
36 views

Login Redirection Issue in Express.js with Passport Authentication

I am developing an Express.js application and facing a persistent issue with user authentication. Despite successful user registration and confirmed entries in the database, the login process does not ...
Ricardo Luna's user avatar
0 votes
0 answers
40 views

Why is my Google social login working despite my app not being published?

I have implemented Google social login for my web application. Here are the steps I've taken so far: Created an OAuth 2.0 Client ID in the Google Cloud Console. Added my application's domains under &...
khem K's user avatar
  • 9
0 votes
0 answers
43 views

passport login issues in session

I'm having trouble with my passport. The login process went through without any issues, but the passport key has to be saved into the session and there is not req.user in the requset the initapp ...
Yossef Sabry's user avatar
0 votes
1 answer
29 views

How do I specify which HTTP method should be used in a redirect in my express application?

I have a NodeJS/Express application where I am using PassportJS for authentication. I have the following routes: router.get("/profile", isUser, (req, res) => { res.render("profile&...
Oscar's user avatar
  • 590
0 votes
0 answers
43 views

How to Configure Google Auth Redirect URI for a Node.js Application on AWS EC2?

I'm currently deploying a Node.js application that uses Google OAuth 2.0 for authentication on an AWS EC2 instance. However, when users attempt to log in using Google, they receive an "access ...
ASHWIN C's user avatar
2 votes
2 answers
316 views

Getting "401 Unauthorized" when accessing protected route in Express.js with express-session and passport

I'm building a blob web application using Express.js where users can log in and access protected routes. I've set up session management using express-session and authentication with passport-local. ...
elclasico's user avatar
0 votes
1 answer
51 views

Cookie not setting in Express with Passport JS

I am using Passport JS for authentication for my MERN app. I am trying to have routes that are protected so you must be authenticated. When I test the routes and /login in Thunder Client and then try ...
jc22920's user avatar
  • 398
0 votes
1 answer
63 views

Mongoose CastError: Cast to ObjectId failed for Twitter ID (type string)

I’m working on a content syndication project where I’m implementing Twitter authentication using Passport.js and Mongoose. The authentication flow works up to the point of deserializing the user. I’m ...
Belmin's user avatar
  • 1
0 votes
1 answer
66 views

Login route returns "Cannot POST /login" - implementing Passport in MERN

I am trying to implement Passport into my MERN application, registering users and all other routes work but whenever I hit the /login POST route I get Cannot POST /login (see image below). This only ...
jc22920's user avatar
  • 398
0 votes
0 answers
30 views

NODE + PASSPORT + GOOGLE STRATEGY: req.user not being persistent and connect.sid not being sent in production environment

I'm working on a MERN stack project and I'm facing this issue where my req object is not being persistent and holding the req.user after it has been authenticated. when the /google/callback enpoint is ...
Amaan's user avatar
  • 5
0 votes
1 answer
210 views

Google OAuth Refresh Token Undefined

I realize that this has come up several times, but I have tried every solution I could find, and my refreshToken is still coming up as undefined. I make sure that I delete my app's 3rd party access. ...
threehappypenguins's user avatar
0 votes
1 answer
43 views

Express request does not inlcude user after passport (local strategy) authentication

Question: I try to authenticate http requests via username and password. The authentication seems to work. But for some reason the user data is not available inside the express routes. Related ...
quentinkrammer's user avatar
0 votes
1 answer
33 views

Passport JS and express-session: req.isAuthenticated() false in production , returns true in development

I am responding to request from client for protected resources based on whether the req.isAuthenticated() flag returns true or false I am hosting my app on render When i had completed the initial ...
DaObliterator's user avatar
0 votes
0 answers
94 views

Keep getting TypeError: Cannot set properties of undefined (setting 'user')

I'm new to Nodejs and Express server. I'm trying to create a webapp where user can log in with their Gmail. My front-end uses Reactjs. However, I keep getting this error TypeError: Cannot set ...
user25247436's user avatar
0 votes
1 answer
65 views

session being overwritten using node js express passport authentication oath2 session for google

Google suggests to ask a user for a minimal set of permission when first signing up a user, and to then ask to extend those permissions when/if needed by the user. So, I have used token based ...
user25295461's user avatar
0 votes
0 answers
52 views

nock is not intercepting HTTPS request to Keyclaok

I have been struggling in the last two days to figure out what is not working well with my nock setup. Description: I work with node environment and express as the application server. The ...
Gavriel's user avatar
  • 51
0 votes
0 answers
24 views

React.js Passport.js session and cookie problem

That's my db session also passport.js configuration in index.js file: const connect = async () => { try { await mongoose.connect(process.env.DB_URL); console.log("Connected ...
Nijat Mansimov's user avatar
0 votes
0 answers
38 views

Trouble Obtaining Refresh Token Alongside Access Token from Dropbox OAuth2 in Local Environment

I'm trying to integrate Dropbox into my web application using OAuth2. My code seems to be working correctly, but I'm only receiving the access token and not the refresh token upon successful login. I'...
Benk I's user avatar
  • 199

1
2 3 4 5
109