Skip to main content
Version: 1.12.0

Interface: CantonTokenSource

Defined in: canton/authentication/types.ts:59

A source of AccessToken values with automatic refresh.

Mirrors the Go oauth2.TokenSource interface. Implementations cache the current token and re-fetch on demand when it is expired or missing.

Methods

token()

token(): Promise<AccessToken>

Defined in: canton/authentication/types.ts:65

Returns a valid (non-expired) access token, fetching or refreshing as needed.

Implementations MUST be safe to call concurrently.

Returns

Promise<AccessToken>