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.
const client = new OpenTDF({ interceptors: [authTokenInterceptor(clientCredentialsTokenProvider({ clientId: 'opentdf', clientSecret: 'secret', oidcOrigin: 'http://localhost:8080/auth/realms/opentdf', }))], platformUrl: 'http://localhost:8080',}); Copy
const client = new OpenTDF({ interceptors: [authTokenInterceptor(clientCredentialsTokenProvider({ clientId: 'opentdf', clientSecret: 'secret', oidcOrigin: 'http://localhost:8080/auth/realms/opentdf', }))], platformUrl: 'http://localhost:8080',});
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.