code: function(req, res, next) {
      var accessTokenUrl = 'https://accounts.google.com/o/oauth2/token';
      var params = {
        code: req.body.code,
        client_id: req.body.clientId,
        client_secret: config.GOOGLE_SECRET,
        redirect_uri: req.body.redirectUri,
        grant_type: 'authorization_code'
      };
      
      request.post(accessTokenUrl, { json: true, form: params }, function(err, response, token) {
        if (response.statusCode !== 200) {
          res.status(500).send(err);
          return;
        }
        var accessToken = token.access_token;
        req.accessToken = accessToken;
        next();
      });
    }
docs: Step 1. Exchange authorization code for access token.