passport-google-oauth2

Problem Redirecting after google signin in express react app using passport-google-oauth20

强颜欢笑 提交于 2021-01-29 07:19:32
问题 I have express backend and create-react-app2 as frontend , I am using setupProxy also. Now I have configured the app for google sign in however I am not getting proper redirect to index page after signin. Here is google oauth setup in console.developer.google.com I am using passport google oauth20 for authentication: Here my passport file: const GoogleStrategy = require('passport-google-oauth20').Strategy; const keys = require('./../keys/secret'); const {User} = require('./../models/user');

How can I make a button trigger the google oauth flow with passport-google-oauth20?

点点圈 提交于 2021-01-28 09:49:43
问题 I want to implement passport-google-oauth20 in my react app. I have to mention that everything work perfect on the server side, the oauth flow signs me up and creates a new user in the database. But in react it just shows a blank page and the address bar show this url, http://localhost:3000/api/auth/google The button: <a href='/api/auth/google'> <button type="submit" className="App_button _oauth"> <div className='socialIcon'> <GoogleIcon width={18} /> </div> <span>Sign up with Google</span> <

How can I make a button trigger the google oauth flow with passport-google-oauth20?

▼魔方 西西 提交于 2021-01-28 09:43:44
问题 I want to implement passport-google-oauth20 in my react app. I have to mention that everything work perfect on the server side, the oauth flow signs me up and creates a new user in the database. But in react it just shows a blank page and the address bar show this url, http://localhost:3000/api/auth/google The button: <a href='/api/auth/google'> <button type="submit" className="App_button _oauth"> <div className='socialIcon'> <GoogleIcon width={18} /> </div> <span>Sign up with Google</span> <

Auto login while using passport-google-oauth20

╄→гoц情女王★ 提交于 2020-08-07 08:07:09
问题 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 authentication window to enter the credentials, it always logs in with the same account. Here is the passport-strategy configuration: const passport = require('passport'); const GoogleStrategy = require('passport-google-oauth20').Strategy; const

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

和自甴很熟 提交于 2020-01-16 22:54:27
问题 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 serverside (Express / Node.js). On clicking the Login button from the frontend, request is sent to the server, which gets redirected to Google to ask for user credentials / permissions etc. My callback URL is : http://localhost:3500/auth/callback. Post

[Passportjs][Angular5] No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access

ぃ、小莉子 提交于 2019-12-11 14:56:00
问题 I am trying to integrate Nodejs backend api with Angular. I have implemented passpor-google, passport-github, passport-twitter strategy on the backend application. My backend App url is http://localhost:3000 My Frontend App url is http://localhost:4200 Passport Routes authRouter.get('/github', passport.authenticate('github')); authRouter.get( '/github/callback', passport.authenticate('github', { failureRedirect: 'http://localhost:4200/login', }), authController.sendJWTToken ); When i send