AzureCommunicationTokenCredential class

The CommunicationTokenCredential implementation with support for proactive token refresh.

Constructors

AzureCommunicationTokenCredential(CommunicationTokenRefreshOptions)

Creates an instance of CommunicationTokenCredential with a lambda to get a token and options to configure proactive refreshing.

AzureCommunicationTokenCredential(string)

Creates an instance of CommunicationTokenCredential with a static token and no proactive refreshing.

Methods

dispose()

Disposes the CommunicationTokenCredential and cancels any internal auto-refresh operation.

getToken(CommunicationGetTokenOptions)

Gets an AccessToken for the user. Throws if already disposed.

Constructor Details

AzureCommunicationTokenCredential(CommunicationTokenRefreshOptions)

Creates an instance of CommunicationTokenCredential with a lambda to get a token and options to configure proactive refreshing.

new AzureCommunicationTokenCredential(refreshOptions: CommunicationTokenRefreshOptions)

Parameters

refreshOptions
CommunicationTokenRefreshOptions

Options to configure refresh and opt-in to proactive refreshing.

AzureCommunicationTokenCredential(string)

Creates an instance of CommunicationTokenCredential with a static token and no proactive refreshing.

new AzureCommunicationTokenCredential(token: string)

Parameters

token

string

A user access token issued by Communication Services.

Method Details

dispose()

Disposes the CommunicationTokenCredential and cancels any internal auto-refresh operation.

function dispose()

getToken(CommunicationGetTokenOptions)

Gets an AccessToken for the user. Throws if already disposed.

function getToken(options?: CommunicationGetTokenOptions): Promise<AccessToken>

Parameters

Returns

Promise<AccessToken>