Comments (14)
Hey guys! are you gonna fix this?
from passport-google-oauth2.
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.
@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.
@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.
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.
This fork resolves the problem https://github.com/passport-next/passport-google-oauth2
from passport-google-oauth2.
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.
Did you complete a pull request @rwky ...
from passport-google-oauth2.
@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.
@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.
@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.
Thank you @julianlam ! I will give it a try!
from passport-google-oauth2.
I've changed those lines to work with Google+ :
passport-google-oauth2/lib/oauth2.js
Lines 45 to 46 in 59253f8
options.authorizationURL = options.authorizationURL || 'https://accounts.google.com/o/oauth2/v2/auth';
options.tokenURL = options.tokenURL || 'https://www.googleapis.com/oauth2/v4/token';
passport-google-oauth2/lib/oauth2.js
Line 91 in 59253f8
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.
Resolved in #15 – many thanks for the assist @Guisch!
from passport-google-oauth2.
Related Issues (13)
- Add cover photo to profile information HOT 1
- Not able to successfully complete the call back HOT 1
- Can I use this with GraphQL HOT 1
- Is the package stable?
- @natanbr yes, here what I'm currently doing: HOT 1
- passport-google-oauth2 + Clustering + SessionStore HOT 2
- No OAuth2 ID_Token parameter in the callback function
- Issue when deployed on server
- Google strategy not returning gender and birthay
- refreshToken HOT 10
- User is not showing up in my req HOT 3
- I got this message when google called callback HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passport-google-oauth2.