Optional
options: {Called by the SDK to get the authentication headers for a specific audience. The audience is a string that identifies the API endpoint that the SDK is trying to access. The SDK will use the provided headers on requests to the Camunda 8 API endpoint.
A promise that resolves to an object containing the authentication headers.
Updates the bearer token used for authentication.
The new bearer token to be used. This should be a valid token string obtained from a trusted source.
The
BearerAuthProvider
class is an implementation of IHeadersProvider that uses a bearer token for authentication. This class is responsible for providing the authentication headers to the SDK. Note that it does not handle token expiration or renewal. The token must be set manually using thesetToken
method. Nor does it handle token retrieval. The token must be provided in the configuration object or set manually using thesetToken
method.This class is useful for scenarios where you have a static bearer token that does not expire or where you want to manage the token lifecycle yourself.
Example