All Questions
Tagged with node.js passport.js
5,450
questions
0
votes
0
answers
15
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 ...
0
votes
1
answer
60
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. ...
0
votes
1
answer
26
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 ...
0
votes
1
answer
44
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 ...
0
votes
1
answer
45
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 ...
0
votes
0
answers
24
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 ...
0
votes
0
answers
18
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.
...
0
votes
1
answer
28
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 ...
-1
votes
0
answers
12
views
Passport JS req.isAuthenticated() returns false when used outside req.login()
I am using passport with react and I am using a custom callback to send the errors if any. I read that while using custom callback I have to use req.login() manually but when I use req.isAuthenticated(...
1
vote
0
answers
25
views
Cross-domain Authentication Issue with Passport.js and Next.js Client
Problems
I'm using Passport.js for authentication on a Node.js server (localhost:8000) and a Next.js client (localhost:3000). Despite trying various solutions, I can't get cross-domain authentication ...
0
votes
1
answer
24
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 ...
0
votes
0
answers
36
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 ...
0
votes
0
answers
24
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 ...
0
votes
0
answers
29
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 ...
0
votes
0
answers
20
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 ...