6,897 questions
1
vote
0
answers
32
views
Different session data for router middleware
I am having trouble understanding how express.js works with routers in this instance. I am using express and passport.js to authenticate and store user data. What I am trying to do currently is have ...
0
votes
0
answers
26
views
Pass key project
I'm trying to implement a passkey in my project.. but when I try to sign up I always get a 403 response back... I'm not able to solve it since 2/3 hours... could you please maybe help? if I debug I ...
-1
votes
0
answers
15
views
Apple Authentication Callback Returns Undefined User Data in passport-apple
I am facing an issue with passport-apple where the authentication is successful, but the req.user object is coming as undefined in the callback function. Specifically, the name field is missing from ...
0
votes
1
answer
60
views
passport.serializeUser & passport.deserializeUser not working
I try to do a login via a LocalStrategy in Passport, but the serializeUser and deserializeUser functions don't seem to be called at all. The versions of the ‘Relevant’ packages are:
"express"...
0
votes
2
answers
42
views
configService in JwtStrategy constructor is undefined
I can't understand why configService is undefined in constructor of jwt.strategy.ts until I add @Inject(ConfigService) decorator before readonly configService: ConfigService, but in other modules ...
0
votes
0
answers
20
views
Express-session and passport issue - session ID is changing when it should not
The TLDR is: what would cause a cookie's sessionID to mismatch the sid saved to my database?
I am updating my ExpressJS application from NodeJS 16 to 22, along with all modules I'm using. I use ...
0
votes
1
answer
40
views
Cookie issues with Passport: why are cookies not sent/stored?
I'm struggling while implementing authentication in my Express application using Passport.js.
First of all here are all my packages' versions and my config:
"passport": "^0.7.0",
&...
0
votes
0
answers
31
views
Vite React Proxy Requests to Backend in Production
As I implement passport's Google OAuth2.0 strategy, I realized I need the callback to hit the server, then from there, I can redirect to a different page depending on if the user needs to finish ...
0
votes
0
answers
39
views
Google OAuth not requesting calendar.events scope in Node.js with Passport.js
I’m using Passport.js with Google OAuth 2.0 in my Node.js app to authenticate users and request access to Google Calendar events. Despite adding the calendar.events scope in both my Passport strategy ...
0
votes
0
answers
57
views
Jwt gives error for invalid: signature, but is not invalid
I'm having an error where after the user logs in, I create an access token and a refresh token, the access token works, and is practically the same as the refresh, it doesn't give an invalid: ...
1
vote
0
answers
55
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 ...
0
votes
1
answer
36
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 ...
0
votes
0
answers
26
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'...
0
votes
0
answers
51
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 ...
0
votes
0
answers
34
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 ...
0
votes
1
answer
36
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: ...
0
votes
0
answers
9
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.
...
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. ...
1
vote
0
answers
51
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 ...
0
votes
0
answers
12
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 ...
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 ...
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 ...
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 ...
0
votes
2
answers
88
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,...
0
votes
0
answers
96
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....
0
votes
0
answers
23
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 ...
1
vote
1
answer
379
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 ...
0
votes
1
answer
35
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://...
0
votes
0
answers
40
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 ...
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 ...
0
votes
0
answers
35
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....
0
votes
0
answers
44
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"
}...
0
votes
0
answers
30
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&...
0
votes
0
answers
91
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 ...
0
votes
1
answer
297
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 ...
0
votes
0
answers
124
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 ...
0
votes
1
answer
73
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 &...
-1
votes
1
answer
32
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 ...
0
votes
0
answers
29
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 ...
0
votes
0
answers
45
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 ...
0
votes
0
answers
122
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 ...
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/@...
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(...
0
votes
0
answers
35
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 ...
0
votes
0
answers
45
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 ...
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');
...
0
votes
0
answers
36
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(...
0
votes
1
answer
52
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 ...
0
votes
0
answers
31
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 { ...
0
votes
1
answer
29
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 ...