How to use the openid-client.custom.http_options 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 / nextjs-auth0 / src / utils / oidc-client.ts View on Github external
return async (): Promise => {
    if (client) {
      return client;
    }

    const issuer = await Issuer.discover(`https://${settings.domain}/`);
    client = new issuer.Client({
      client_id: settings.clientId,
      client_secret: settings.clientSecret,
      redirect_uris: [settings.redirectUri],
      response_types: ['code']
    });

    if (clientSettings.httpTimeout) {
      const timeout = clientSettings.httpTimeout;
      client[custom.http_options] = function setHttpOptions(options: ClientSettings): ClientSettings {
        return {
          ...options,
          timeout
        };
      };
    }

    if (clientSettings.clockTolerance) {
      client[custom.clock_tolerance] = clientSettings.clockTolerance / 1000;
    }

    return client;
  };
}
github gardener / dashboard / backend / lib / security.js View on Github external
function overrideHttpOptions () {
  this[custom.http_options] = options => Object.assign({}, options, httpOptions)
}
overrideHttpOptions.call(Issuer)