docs: function (soajs, data, cb) {
          let username = data.username;
          let password = data.password;
          let ldapServer;
  
          if (soajs.servicesConfig.urac && soajs.servicesConfig.urac.ldapServer) {
              ldapServer = soajs.servicesConfig.urac.ldapServer;
          }
          else {
              return cb({"code": 706, "msg": soajs.config.errors[706]});
          }
          let host = ldapServer.host;
          let port = ldapServer.port;
          let baseDN = ldapServer.baseDN.replace(new RegExp(' ', 'g'), '');
          let adminUser = ldapServer.adminUser.replace(new RegExp(' ', 'g'), '');
          let adminPassword = ldapServer.adminPassword;
          let url = host + ":" + port;
  
          let filter = 'uid=' + username;
          let fullFilter = 'uid=' + username + ',' + baseDN;
  
          let ad = new ActiveDirectory({
              url: url,
              baseDN: baseDN,
              username: adminUser,
              password: adminPassword
          });
  
          ad.authenticate(fullFilter, password, function (err, auth) {
              if (err) {
                  soajs.log.error(err);
                  if (err.code && err.code === 'ECONNREFUSED') {
                      soajs.log.error("Connection Refused!");
                      return cb({"code": 700, "msg": soajs.config.errors[700]});
                  }
                  if (err.lde_message) {
                      if (err.lde_message.includes('Incorrect DN given')) { // invalid admin username
                          soajs.log.error("Incorrect DN given!");
                          return cb({"code": 701, "msg": soajs.config.errors[701]});
                      }
  
                      if (err.lde_message.includes('INVALID_CREDENTIALS') && err.lde_message.includes(adminUser)) { // invalid admin credentials (wrong admin password)
                          soajs.log.error("Invalid Admin Credentials");
                          return cb({"code": 702, "msg": soajs.config.errors[702]});
                      }
  
                      if (err.lde_message.includes('INVALID_CREDENTIALS') && err.lde_message.includes(filter)) { // invalid user credentials (wrong user password)
                          soajs.log.error("Invalid User Credentials");
                          let obj = {"code": 703, "msg": soajs.config.errors[703]};
                          return cb(obj);
                      }
                  }
  
                  return cb({"code": 704, "msg": soajs.config.errors[704]});
              }
  
              if (auth) {
                  soajs.log.debug('Authenticated!');
  
                  ad.find(filter, function (err, user) {
                      // since the user is authenticated, no error can be generated in this find call
                      // since we are searching using the filter => we will have one result
                      let userRecord = user.other[0];
  
                      initBLModel(soajs, function (err) {
                          if (err) {
                              return cb(err);
                          }
                          utilities.saveUser(soajs, driver.model, 'ldap', userRecord, function (error, record) {
                              return cb(null, record);
                          });
                      });
  
                  });
  
              }
              else {
                  soajs.log.error("Authentication failed.");
                  return cb({"code": 705, "msg": soajs.config.errors[705]});
              }
          });
      }