Questions tagged [passport-google-oauth2]

87 questions
9
votes
3 answers

Passport Google Oauth2 not prompting select account when only 1 google account logged in

I'm trying to authenticate users in my node + nestjs api and want to prompt the user to select an account. The prompt does not show up if you have only 1 account logged in and even when you are logged in with 2 accounts and you get prompted, the…
6
votes
2 answers

passport-google-oauth2 vs passport-google-oauth20 packages

These 2 packages look very similar: http://www.passportjs.org/packages/passport-google-oauth2/ http://www.passportjs.org/packages/passport-google-oauth20/ Is one supersede the other or they serve different purpose? New to Google authentication and…
hubpixel
  • 319
  • 1
  • 10
5
votes
1 answer

How to use bearer and oauth2 passport.js strategies togheter?

Recently I started using passport.js with the oauth2 strategies for authentication. at first, I was using sessions and everything was great but I want my API to be stateless. the only thing I found that could help me with this is the bearer…
5
votes
0 answers

How to tell between actual picture vs. default auto-generated image in Google OAuth?

I'm retrieving user data from Google using the Passport Google Strategy (OAuth 2.0). This works fine except when the logged-in user does not have an explicitly set profile picture. In such cases, Google returns a default image with the user's…
TheLearner
  • 2,813
  • 5
  • 46
  • 94
5
votes
0 answers

How can I extract other API scopes from a passport callback?

I want to get the birthday of an user using Passport.js with the passport-google-oauth20 strategy. Where do I get the response of this extra scope and how do I extract this information? I am having success on extracting the profile and email from an…
4
votes
0 answers

Google Oauth2 in embedded browser (web view)

I added Google OAuth2 to my website. I noticed that when the website was opened in a embedded browser (web view), redirecting to google auth page (see the link below) will fail with error: "403 disallowed_useragent". Here is the…
AI YO
  • 41
  • 3
4
votes
1 answer

Endpoints not authenticating with Fetch API calls (using passport-google-oauth2)

I have passport set up to use the Google strategy and can direct to the /auth/google great. I currently have it so that when you log in using the google authentication oauth2, my endpoints will authenticate by checking for a req.user. This works…
4
votes
2 answers

All possible scope options in Passport for Facebook and Google

I am unable to locate all possible scope options in passport for facebook and google. Could anyone mention all possible scope option/values that we could pass during authentication for facebook and google? I need to use other scope options for…
3
votes
0 answers

Internal OAuth Error: Failed to fetch user profile NodeJs with passport-google-oAuth2

Here is my code to authenticate user based on google email : router.use(passport.initialize()); passport.serializeUser((user, done) => { done(null, user); }); passport.deserializeUser((user, done) => { done(null,…
Sara Ree
  • 3,417
  • 12
  • 48
3
votes
2 answers

How to send JWT to front end server after successful login for storage on localStorage?

In my current application after the users logs in with google (passport strategy), I generate a JWT token on the server and then I have no idea how to send it back whilst also redirecting the user to the front end website. While searching I read…
Ahmed Nasr
  • 319
  • 5
  • 12
3
votes
0 answers

Properly handling Google OAuth with separated frontend and backend

I have my frontend using React/Next.JS, and I'm wanting to implement Google OAuth for authentication to the users info in the backend. On the backend, I'm using Express and Passport for routing and authentication respectively. I got all of this…
Daedalus
  • 3,632
  • 4
  • 14
  • 18
3
votes
1 answer

React proxy request to back-end API to initiate Passport, Google OAuth2 request

SO Community, I am working on using Passport's Google-OAuth2 strategy with a React front-end. Currently, I am able to get to the Google Login page front the back-end API call via Postman. However, if I make the call from the front-end using React,…
3
votes
1 answer

Redirect to Frontend ( On A Different URL ) after OAuth2 Login

I am trying to setup my application as follow : Angular 7 frontend, served at, say http://localhost:4200 Express backend, served at, say http://localhost:3500 Passport library for OAuth2 Authentication I am setting up OAuth2 flow from the…
vasu014
  • 187
  • 1
  • 3
  • 12
3
votes
1 answer

loopback passport google hd param

I am using a loopback-component-passport to authenticate users via google OAuth2Strategy. Everything works well except passing the "hd" or "hostedDomain" param to google. My provider.json looks like this: { "google-auth": { "provider": "google", …
Tomas Javurek
  • 1,493
  • 2
  • 9
  • 16
3
votes
1 answer

Auto login while using passport-google-oauth20

I followed a course and it implemented user authentication using passport, passport-google-oauth20, cookie-session and it all works fine (login, logout, session handling) but when i send a request for a Log in/Sign Up it doesnt ask/prompt the google…
Roger S
  • 31
  • 3
1
2 3 4 5 6