lib/passport-google-id-token/strategy.js
function getGoogleCerts(kid, callback) {
  request({uri: 'https://www.googleapis.com/oauth2/v1/certs'}, function(err, res, body) {
    if (err || !res || res.statusCode != 200) {
      err = err || new Error('error while retrieving Google certs');
      callback(err);
    } else {
      try {
        var keys = JSON.parse(body);
      } catch (e) {
        return callback(new Error('could not parse certs'));
      }

      callback(null, keys[kid]);
    }
  });
}
function getGoogleCerts(kid, callback) {
  request({uri: 'https://www.googleapis.com/oauth2/v1/certs'}, function(err, res, body) {
    if (err || !res || res.statusCode != 200) {
      err = err || new Error('error while retrieving Google certs');
      callback(err);
    } else {
      try {
        var keys = JSON.parse(body);
      } catch (e) {
        return callback(new Error('could not parse certs'));
      }

      callback(null, keys[kid]);
    }
  });
}
function getGoogleCerts ( kid , callback ) { request ( { uri : 'https://www.googleapis.com/oauth2/v1/certs' } , function ( err , res , body ) { if ( err || ! res || res . statusCode != 200 ) { err = err || new Error ( 'error while retrieving Google certs' ) ; callback ( err ) ; } else { try { var keys = JSON . parse ( body ) ; } catch ( e ) { return callback ( new Error ( 'could not parse certs' ) ) ; } callback ( null , keys [ kid ] ) ; } } ) ; }
Return the Google certificate that will be used for signature validation.

A custom function can be used instead when passed as an option in the Strategy
constructor. It can be interesting e.g. if caching is needed.

@param {String} kid The key id specified in the token
@param {Function} callback
@api protected
Return the Google certificate that will be used for signature validation .