How to use the openid-client.custom.setHttpOptionsDefaults function in openid-client

To help you get started, we’ve selected a few openid-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github auth0 / express-openid-connect / lib / client.js View on Github external
};
    } else {
      throw new Error("The issuer doesn't support session management.");
    }
  }

  let httpOptions = config.httpOptions || {};
  httpOptions.headers = Object.assign(
    // Allow configuration to override user agent header.
    {'User-Agent': `${pkg.name}/${pkg.version}`},
    httpOptions.headers || {},
    // Do not allow overriding telemetry.
    {'Auth0-Client': Buffer.from(JSON.stringify(telemetryHeader)).toString('base64')}
  );

  custom.setHttpOptionsDefaults(httpOptions);

  client[custom.clock_tolerance] = config.clockTolerance;

  return client;
}