Git Product home page Git Product logo

Comments (14)

kogal avatar kogal commented on August 23, 2024 1

Hey guys! are you gonna fix this?

from passport-google-oauth2.

julianlam avatar julianlam commented on August 23, 2024

So far as I know, there are no plans to discontinue plain OAuth 2.0 authentication, so passport-google-oauth2 should continue working, but I would definitely appreciate some confirmation on that.

from passport-google-oauth2.

rwky avatar rwky commented on August 23, 2024

@julianlam is correct, the plan OAuth2 is sticking around (and is now what users should switch to instead of plus). So everything is fine.

from passport-google-oauth2.

CatalinaMoisuc avatar CatalinaMoisuc commented on August 23, 2024

@nysky1 @julianlam
See the documentation added here: https://github.com/jaredhanson/passport-google-oauth2/pull/51/files#diff-04c6e90faac2675aa89e2176d2eec7d8R102 on how to make make it use the userinfo endpoint instead of the old google+ one to comply with the new requirements.

from passport-google-oauth2.

rwky avatar rwky commented on August 23, 2024

I stand corrected the login uses the google oauth2 apis the profile uses the old plus api

https://github.com/mstade/passport-google-oauth2/blob/master/lib/oauth2.js#L91

from passport-google-oauth2.

rwky avatar rwky commented on August 23, 2024

This fork resolves the problem https://github.com/passport-next/passport-google-oauth2

from passport-google-oauth2.

julianlam avatar julianlam commented on August 23, 2024

Isn't changing the userRoute enough to become compliant with the Google+ API shutdown? I also switched to passport-google-oauth20, myself.

from passport-google-oauth2.

nysky1 avatar nysky1 commented on August 23, 2024

Did you complete a pull request @rwky ...

from passport-google-oauth2.

rwky avatar rwky commented on August 23, 2024

@nysky1 nope the repo is a fork not intended for merging back into this one. You can use the fork it has packages published in npm.

from passport-google-oauth2.

minotogna avatar minotogna commented on August 23, 2024

@nysky1 @rwky anyone has an update on how to use the new auth api with this? Why having different node modules ?

from passport-google-oauth2.

julianlam avatar julianlam commented on August 23, 2024

@minotogna FWIW here's the change I made:

julianlam/nodebb-plugin-sso-google@8b8392c

It seems to work with existing implementations (id and secret), although I have no freaking clue how to generate a new client id and secret for a brand new install ever since Google changed their backend layout. Anyone got tips?

from passport-google-oauth2.

minotogna avatar minotogna commented on August 23, 2024

Thank you @julianlam ! I will give it a try!

from passport-google-oauth2.

jeremiepape avatar jeremiepape commented on August 23, 2024

I've changed those lines to work with Google+ :

options.authorizationURL = options.authorizationURL || 'https://accounts.google.com/o/oauth2/auth';
options.tokenURL = options.tokenURL || 'https://accounts.google.com/o/oauth2/token';
with :

  options.authorizationURL = options.authorizationURL || 'https://accounts.google.com/o/oauth2/v2/auth';
  options.tokenURL = options.tokenURL || 'https://www.googleapis.com/oauth2/v4/token';

this._oauth2.get('https://www.googleapis.com/plus/v1/people/me', accessToken, function (err, body, res) {
with :
this._oauth2.get('https://www.googleapis.com/oauth2/v3/userinfo', accessToken, function (err, body, res) {

In my Google Strategy I use "email" not "profile, so I've changed for :

  passport.use('google', new GoogleStrategy({

      clientID: config.google.clientID,
      clientSecret: config.google.clientSecret,
      callbackURL: config.google.callbackURL,
      passReqToCallback : true

    }, (req, accessToken, refreshToken, email, done) => {

Finally, in your routes file you can request like this :
passport.authenticate('google', { scope: ['email'] })
or like this if you need profile (do not forget to add it in your GoogleStrategy callback)
passport.authenticate('google', { scope: ['email', 'profile'] })

from passport-google-oauth2.

mstade avatar mstade commented on August 23, 2024

Resolved in #15 – many thanks for the assist @Guisch!

from passport-google-oauth2.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.