How to use the openid-client.custom.clock_tolerance 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
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;
}
github auth0 / nextjs-auth0 / src / utils / oidc-client.ts View on Github external
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
return pRetry(async () => {
    const issuer = await discoverIssuer(url)
    overrideHttpOptions.call(issuer)
    const client = new issuer.Client({
      client_id: clientId,
      client_secret: clientSecret
    })
    overrideHttpOptions.call(client)
    client[custom.clock_tolerance] = clockTolerance
    return client
  }, {
    forever: true,