Passportjs - How do I request a user's image using the Google strategy?

Problem

How can I configure my Google API access to request a user's image while authenticating? Currently 'profile' only contains the following properties after a user has successfull authenticated:

profile.identifier : (string)

profile.displayName : (string)

profile.emails : (object)

name :(object)

Isn't it possible to request the user's account image? Here is my current Passport/Google strategy configuration:

passport.use(new GoogleStrategy({
    clientID: CLIENT_ID,
    clientSecret: CLIENT_SECRET, 
    returnURL: 'http://localhost:3000/auth/google/return',
    realm: 'http://localhost:3000'
  },
  function(identifier, profile, done) {
    console.log('identifier ' + identifier)
    for(var p in profile){
        console.log(p + ' : ' + profile[p])
        if(p === 'name'){
            for(var n in profile[p]){
                console.log(n + ' : ' + profile[p][n])
            }
        }
    }
  }
));

You can see that I am inspecting the profile to see what information is returned. I assume this needs to be configure somehow in my Google Api console. Is this a Google+ api feature?

Problem courtesy of: Nick

Solution

The profile object returned by passport, only maps a few fields:

profile.id = json.id;
profile.displayName = json.name;
profile.name = { familyName: json.family_name,
                 givenName: json.given_name };
profile.emails = [{ value: json.email }];

But it does give you back a _json property that contains more information:

Try:

var picture = profile._json['picture'];
Solution courtesy of: Eugenio Pace

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.