Tuesday, 15 May 2012

javascript - Google plus user age range using passport.js -



javascript - Google plus user age range using passport.js -

i'm using passportjs oauthstrategy2 jared hanson (https://github.com/jaredhanson/passport-google-oauth). want user age range in profile object can't it. if i'm using https://www.googleapis.com/auth/plus.login in scope, google guarantees homecoming age scope. there way obtain info through passport or i'll forced create rest request google past passport?

this passport authenticate scope i'm using:

app.get('/auth/login/google', passport.authenticate('google', { scope: ['https://www.googleapis.com/auth/plus.login', 'https://www.googleapis.com/auth/userinfo.email' ] }), function(req, res) {});

and result got:

{ provider: 'google', id: '115346138147341087148', displayname: 'testing account', name: { familyname: 'account', givenname: 'testing' }, emails: [ { value: undefined } ], _raw: '{\n "id": "115346138147341087148",\n "name": "testing account",\n "given_name": "testing",\n "family_name": "account",\n "link": "https://plus.google.com/115346138147341087148",\n "picture": "https://lh3.googleusercontent.com/- xduiqdmkcwa/aaaaaaaaaai/aaaaaaaaaaa/4252rscbv5m/photo.jpg",\n "gender": "female",\n "locale": "en"\n}\n', _json: { id: '115346138147341087148', name: 'testing account', given_name: 'testing', family_name: 'account', link: 'https://plus.google.com/115346138147341087148', picture: 'https://lh3.googleusercontent.com/-xduiqdmkcwa/aaaaaaaaaai/aaaaaaaaaaa/4252rscbv5m/photo.jpg', gender: 'female', locale: 'en' } }

thank in advance.

as pointed out somewhere else (probably stackoverflow or similar), not possible more info using passport-google. , have utilize official google api methods more info. unfortunately there not alternative add together profilefields strategy request more info in response (as possible passport-facebook).

javascript node.js google-oauth passport.js

No comments:

Post a Comment