6,909 questions
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 ...
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 ...
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'...
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 ...
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 ...
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: ...
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.
...
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
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 ...
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 ...
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
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,...
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....
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 ...
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 ...
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://...
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 ...
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
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....
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"
}...
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&...
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 ...
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 ...
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 ...
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 &...
-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 ...
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 ...
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 ...
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 ...
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
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 ...
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 ...
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
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(...
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 ...
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 { ...
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 ...
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,...
-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 ...
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 ...
-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 ...
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:
...
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 ...
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://...
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: ...
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 ...
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 ...