AzureCommunicationTokenCredential class
The CommunicationTokenCredential implementation with support for proactive token refresh.
Constructors
| Azure |
Creates an instance of CommunicationTokenCredential with a lambda to get a token and options to configure proactive refreshing. |
| Azure |
Creates an instance of CommunicationTokenCredential with an Entra ID token credential. In most cases, you might want to use InteractiveBrowserCredential to sign in your user. |
| Azure |
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. |
| get |
Gets an |
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(EntraCommunicationTokenCredentialOptions)
Creates an instance of CommunicationTokenCredential with an Entra ID token credential. In most cases, you might want to use InteractiveBrowserCredential to sign in your user.
new AzureCommunicationTokenCredential(entraOptions: EntraCommunicationTokenCredentialOptions)
Parameters
- entraOptions
- EntraCommunicationTokenCredentialOptions
Options to configure the Entra ID token credential.
AzureCommunicationTokenCredential(string | AccessToken)
Creates an instance of CommunicationTokenCredential with a static token and no proactive refreshing.
new AzureCommunicationTokenCredential(token: string | AccessToken)
Parameters
- token
-
string | AccessToken
A user access token issued by Communication Services. Pass an AccessToken
to supply the expiry explicitly when the token cannot be decoded (e.g. an encrypted token).
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
- options
- CommunicationGetTokenOptions
Returns
Promise<AccessToken>