Class: CantonClientCredentialsProvider
Defined in: canton/authentication/client-credentials.ts:63
Client credentials auth provider.
Uses a CachingTokenSource so the first tokenSource().token() call
fetches a token and subsequent calls return the cached value until it expires.
Implements
Properties
type
readonlytype:"clientCredentials"
Defined in: canton/authentication/client-credentials.ts:64
The auth scheme this provider was built from.
Implementation of
Methods
tokenSource()
tokenSource():
CantonTokenSource
Defined in: canton/authentication/client-credentials.ts:75
Returns the caching token source.
Returns
Implementation of
CantonAuthProvider.tokenSource
fromDirect()
staticfromDirect(config:ClientCredentialsAuthConfig& {tokenUrl:string; },options?:OAuthRequestOptions):ClientCredentialsProvider
Defined in: canton/authentication/client-credentials.ts:164
Create a provider with an explicit token endpoint URL (no discovery).
Suitable for environments where the token endpoint is known in advance.
A minimal oauth4webapi.AuthorizationServer is constructed from the
provided authUrl (issuer) and tokenUrl.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | ClientCredentialsAuthConfig & { tokenUrl: string; } | Client credentials config plus a tokenUrl. |
options? | OAuthRequestOptions | Optional fetch override and abort signal. |
Returns
ClientCredentialsProvider
A ClientCredentialsProvider.
Throws
CCIPError (CANTON_AUTH_ERROR) on invalid config.
fromDiscovery()
staticfromDiscovery(config:ClientCredentialsAuthConfig,options?:OAuthRequestOptions):Promise<ClientCredentialsProvider>
Defined in: canton/authentication/client-credentials.ts:123
Create a provider using OAuth2 Authorization Server Metadata discovery (RFC 8414) to automatically locate the token endpoint.
This is the recommended approach when the authorization server supports metadata discovery, as it eliminates the need to manually specify the token endpoint URL.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | ClientCredentialsAuthConfig | Client credentials config with authUrl (authorization server base URL). |
options? | OAuthRequestOptions | Optional fetch override and abort signal. |
Returns
Promise<ClientCredentialsProvider>
A ClientCredentialsProvider.
Throws
CCIPError (CANTON_AUTH_ERROR) on discovery failure or invalid config.