async login() {
    const params = JSON.stringify(
      this._buildParams({
        UserName: 'admin',
        Password: 'admin1234'
      })
    );
    const options = {
      method: 'POST',
      host: 'localhost',
      port: '9999',
      path: '/auth/login',
      agent: this._agent,
      rejectUnauthorized: false
    };
    debug(`Logging in: ${params}.`);
    return new Promise((resolve, reject) => {
      const req = https.request(options, (res) => {
        const cookie = res.headers['set-cookie'];
        let raw = '';
        res.on('data', (chunk) => {
          raw += chunk;
        });
        res.on('end', () => {
          debug(`Login back: ${raw}.`);
          try {
            let parsed = JSON.parse(raw);
            if (parsed.code === 200) {
              debug(`Login successfully and got cookie ${cookie}.`);
              resolve(cookie);
            } else {
              reject(new Error(`${parsed.message}`));
            }
          } catch (err) {
            reject(new Error('Server Internal Error'));
          }
        });
      });
      req.on('error', (e) => {
        console.error(`Request to login error: ${e}`);
        reject(e);
      });
      req.write(params);
      req.end();
    });
  }
Authenticate the client.

@returns {Promise<Void>}