Skip to main content
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
23 views

passport.js + Google: automatically redirect to login page if user is not authenticated

I use passport.js to log in with Google account to my web app. There is a login button if the user clicks on it then they can choose a Google account to log in, it works fine. What I want is if no ...
Viktor's user avatar
  • 1,487
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
36 views

Nestjs, passport refresh access token strategy, graphql context

I use nestjs with graphql and passport with fastify adapter. I try to implement refresh token logic as additional logic to local strategy. My problem is: when i set passReqToCallback to true, in my ...
vladbelozertsev'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
0 votes
1 answer
34 views

Jest mockImplementation doesn't appear to override initial mocked module's function

I am testing a fairly simple node API endpoint: import { getRaces } from '@/services/races'; import { Request, Response, Router } from 'express'; import passport from 'passport'; export default (app: ...
mealeyst's user avatar
0 votes
0 answers
7 views

How to create custom response logic on passport.authenticate fail state?

my frontend is a React S.P.A. (Single Page Application). Therefore, when passport.authenticate('local') results in a failure, I do not want to use 'failureRedirect' because I do not desire a redirect. ...
chron1cle's user avatar
1 vote
0 answers
11 views

User data not stored in session with passport.js

I try to run authentification with passport.js 1. I configure the sessions app.use(session({ ...sessionConfig, ...{ cookie: { secure: isProduction }, store: sessionStore } })); Sessions work fine 2. ...
Porteurs Libres's user avatar
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
0 answers
47 views

Configuration of Keycloak and Passport on a Nestjs Project

CONTEXT: we have a project based on Docker Containers, front and back are done with their dockerfile, that are called in the compose.yaml (we have 3 dir, front, back and infrastructure (where compose....
Dev11's user avatar
  • 1
0 votes
0 answers
22 views

Testing passport.js login with selenium in CI fashion

I have a set of existing selenium (Selenium Webdriver 4, python) tests for a website that will henceforth be authenticated with passsport.js google oauth2. I want to continue automating the end-to-end ...
C. Peck's user avatar
  • 3,717
1 vote
1 answer
280 views

Microsoft Entra Id authentication with PassportJs

I have a website whereby I wish to authenticate users with Microsoft Entra Id (formerly Azure Ad) However, I've found that the "out of the box" way that Entry Id authenticates is a bit ...
Darren Gates'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
0 answers
64 views

How to pass query parameter to Google strategy passport nestJs

Ok, so I am trying to pass a query parameter from my mobile app as /auth/google?purpose=addPlatform to my backend so that I can do stuff with that. Right now is not picking up the parameter. I am ...
chewie's user avatar
  • 569
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
0 answers
110 views

NestJs: Setup passport strategy for Linked authentication using OpenId

I am trying to setup "Sign In with LinkedIn using OpenID Connect" in my nestjs application. I tried to setup using passport-linkedin-oauth2 but was always getting you dont have access to ...
user3479754'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
-1 votes
1 answer
30 views

OAuth 2.0 Spotify InternalOAuthError

InternalOAuthError: failed to fetch user profile    at C:\Users\PAKSHAL\Documents\Pakshal\Projects\Saarang\backend\node_modules\passport-spotify\lib\passport-spotify\strategy.js:151:19    at ...
Pakshal Shah's user avatar
0 votes
0 answers
26 views

Passport.js session returns undefined for req.user in TRPC-context

I'm using Express.js with Passport.js for user authentication in my Vue 3 app. My session setup uses express-session and cookie-parser to store session cookies. While the authentication works, when I ...
silj6's user avatar
  • 1
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
1 vote
0 answers
25 views

how do i verify user using oauth 2 after redirect in callbackURL how to send my session data to frontend

Here is backend....in localhost:3000 import { Router } from "express"; import passport from "passport"; import "../stratergies/DiscordStratergy.js" const router = Router(...
Shubham's user avatar
  • 29
0 votes
0 answers
33 views

401 Unauthorized and req.user Undefined After Deployment (Local Works Fine)

0 I have a MEVN app using Passport.js for authentication. Everything works fine when both the server and client are running locally. However, after deploying one or both the server (on Back4App) and ...
Faruq Alawy Hudaya's user avatar
0 votes
0 answers
38 views

Issues with connect.sid Cookie Disappearing in Production After Enabling CORS

I'm experiencing an issue with the connect.sid cookie in my Express application. Everything works perfectly in my local environment, where the cookie is created and persists as expected. However, once ...
Ajay Kumar Gupta's user avatar
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
46 views

express-session production latency issue with passport.js and render.com

It works in localhost, but in production the authentication is quite slow and takes at least a few seconds so the user still sees the 'login' page and then it magically 'jumps' to the site. The app is ...
Yafim Simanovsky's user avatar
0 votes
0 answers
30 views

Why I need to use passport JS

For example I have RolesGuard: import { CanActivate, ExecutionContext, ForbiddenException, Injectable, UnauthorizedException } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; import { ...
Морфей'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
0 votes
0 answers
29 views

Issues Retrieving User Email with Google OAuth 2.0 in Passport.js Integration

I’m encountering an issue with retrieving the user's email address during Google OAuth 2.0 authentication using Passport.js. Despite configuring the appropriate scopes and ensuring that the email ...
Ajay Kumar Gupta'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
0 votes
0 answers
77 views

Duplicate Session Entry and Missing Session Support

I'm building a Discord bot dashboard API using NestJS, Passport, and TypeORM for session management. When a user attempts to log in through Discord, I encounter two errors: [Nest] 19524 - 09.08.2024 ...
Meenic's user avatar
  • 3
1 vote
0 answers
29 views

What is the actual use of local guard on a login route in nest js, that under the hood is using auth service which generates token on correct match?

[AuthController code](https://i.sstatic.net/TpKVgh6J.png) [Localstrategy code:](https://i.sstatic.net/EdFhToZP.png) [Auth service code:](https://i.sstatic.net/gYA5LJSI.png) [Jwt strategy code](https://...
Aditya Raj'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

1
2 3 4 5
139