You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i use :
"passport-google-oauth20": "^2.0.0",
"express": "~4.16.1",
"express-session": "^1.17.2",
"passport": "^0.4.1"
this is my Strategy:
`const passport = require('passport')
const GoogleStrategy = require('passport-google-oauth20').Strategy;
Yes please,
I have also enabled People API
&
provided these two scopes https://www.googleapis.com/auth/user.birthday.read', 'https://www.googleapis.com/auth/user.gender.read
apart from email and profile.
i use :
"passport-google-oauth20": "^2.0.0",
"express": "~4.16.1",
"express-session": "^1.17.2",
"passport": "^0.4.1"
this is my Strategy:
`const passport = require('passport')
const GoogleStrategy = require('passport-google-oauth20').Strategy;
passport.use(
new GoogleStrategy({
clientID: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
callbackURL: process.env.CALLBACK_URL_GOOGLE
},
function(accessToken, refreshToken, profile, done) {
console.log(profile, accessToken);
}
));
this is my router:
router.get('/google', passport.authenticate('google', {scope : [
'profile',
'email',
'https://www.googleapis.com/auth/user.uality.read'
]
}))
router.get('/google/callback', passport.authenticate('google', { failureRedirect: '/error', successRedirect: "/success" }));`
this is console.log:
{
id: '1015931753071********',
displayName: 'My Display name',
name: { familyName: 'My family name', givenName: 'My Given Name' },
emails: [ { value: '[email protected]', verified: true } ],
photos: [
{
value: 'https://lh3.googleusercontent.com/a-/AOh14GhJ9sdtyGrLayeQb5qj0rKRwDYnOYIGFk6_aOtY7A=s96-c'
}
],
provider: 'google',
_raw: '{\n' +
' "sub": "1015931753071********",\n' +
' "name": "My Display name",\n' +
' "given_name": "My Given Name",\n' +
' "family_name": "My family name",\n' +
' "picture": "https://lh3.googleusercontent.com/a-/AOh14GhJ9sdtyGrLayeQb5qj0rKRwDYnOYIGFk6_aOtY7A\\u003ds96-c",\n' +
' "email": "[email protected]",\n' +
' "email_verified": true,\n' +
' "locale": "vi"\n' +
'}',
_json: {
sub: '101593175307110226481',
name: 'My Display name',
given_name: 'My Given Name',
family_name: 'My family name',
picture: 'https://lh3.googleusercontent.com/a-/AOh14GhJ9sdtyGrLayeQb5qj0rKRwDYnOYIGFk6_aOtY7A=s96-c',
email: '[email protected]',
email_verified: true,
locale: 'vi'
}
} ya29.a0AfH6SMCOBsQ1J79_ZkvWNES71eCd_GtfY7TkKaDydTuMg5bwq3lQ6-b3bjhHib2qVbof24CR0Ch_187P784_Oib2Qq5Z3OlahDt1HadMpePs5pGEg7GxdadQlDykoNSvJXYcNhBS3iSgPxDSU4mr0DvTt8yd
The text was updated successfully, but these errors were encountered: