docs: function (req, config, callback) {
      var baseUrl = config.web.baseUrl || req.protocol + '://' + getHost(req);
      var linkedInAuthUrl = 'https://www.linkedin.com/uas/oauth2/accessToken';
      var linkedInProvider = config.web.social.linkedin;
  
      var options = {
        form: {
          grant_type: 'authorization_code',
          code: req.query.code,
          redirect_uri: baseUrl + linkedInProvider.uri,
          client_id: linkedInProvider.clientId,
          client_secret: linkedInProvider.clientSecret
        }
      };
  
      request.post(linkedInAuthUrl, options, function (err, result, body) {
        var parsedBody;
  
        try {
          parsedBody = JSON.parse(body);
        } catch (err) {
          return callback(err);
        }
  
        if (parsedBody.error) {
          var errorMessage;
  
          switch (parsedBody.error) {
            case 'unauthorized_client':
              errorMessage = 'Unable to authenticate with LinkedIn. Please verify that your configuration is correct.';
              break;
  
            default:
              errorMessage = 'LinkedIn error when exchanging auth code for access token: ' + parsedBody.error_description + ' (' + parsedBody.error + ')';
          }
  
          return callback(new Error(errorMessage));
        }
  
        callback(err, parsedBody.access_token);
      });
    }