authenticate(request, strategyName) {
    const response = new PassportResponse();

    return new Bluebird((resolve, reject) => {
      // This listener is invoked when a redirection is required by the strategy (e.g. OAUTH)
      // In that case, the strategy's verify function is not called, and
      // neither is the authenticate's callback.
      // Thus, despite the apparences, the promise can only be resolved once.
      // (Proof: HTTP redirection unit test)
      response.addEndListener(() => resolve(response));

      const authCB = (err, user, info) => {
        if (err !== null) {
          if (err instanceof KuzzleError) {
            reject(err);
          } else {
            reject(
              kerror.getFrom(
                err,
                "plugin",
                "runtime",
                "unexpected_error",
                err.message,
              ),
            );
          }
        } else if (!user) {
          reject(
            kerror.get("plugin", "strategy", "missing_user", info.message),
          );
        } else {
          resolve(user);
        }
      };

      try {
        passport.authenticate(
          strategyName,
          this.options[strategyName] || {},
          authCB,
        )(request, response);
      } catch (e) {
        if (e instanceof KuzzleError) {
          reject(e);
        } else {
          reject(
            kerror.getFrom(
              e,
              "plugin",
              "runtime",
              "unexpected_error",
              e.message,
            ),
          );
        }
      }
    });
  }
@param {{query: Object}}request
@param strategyName
@returns {Promise.<*>}