@opentdf/sdk
    Preparing search index...

    Function clientCredentialsTokenProvider

    • Creates a TokenProvider that obtains tokens via the OAuth2 client credentials grant. Tokens are cached and automatically refreshed when expired.

      Not for browser use. Client secrets must not be exposed in client-side code. Use this only in server-side (Node.js/Deno) environments.

      Returns TokenProvider

      const client = new OpenTDF({
      interceptors: [authTokenInterceptor(clientCredentialsTokenProvider({
      clientId: 'opentdf',
      clientSecret: 'secret',
      oidcOrigin: 'http://localhost:8080/auth/realms/opentdf',
      }))],
      platformUrl: 'http://localhost:8080',
      });