CommunicationTokenCredential Class
Credential type used for authenticating to an Azure Communication service.
Constructor
CommunicationTokenCredential(token: str, **kwargs: Any)
Parameters
| Name | Description |
|---|---|
|
token
Required
|
The token used to authenticate to an Azure Communication service. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
token_refresher
|
Callable[[], <xref:AccessToken>]
The sync token refresher to provide capacity to fetch a fresh token. The returned token must be valid (expiration date must be in the future). |
|
proactive_refresh
|
Whether to refresh the token proactively or not. If the proactive refreshing is enabled ('proactive_refresh' is true), the credential will use a background thread to attempt to refresh the token within 10 minutes before the cached token expires, the proactive refresh will request a new token by calling the 'token_refresher' callback. When 'proactive_refresh' is enabled, the Credential object must be either run within a context manager or the 'close' method must be called once the object usage has been finished. |
Methods
| close | |
| get_token |
The value of the configured token. :param any scopes: Scopes to be added to the token. :return: AccessToken :rtype: ~azure.core.credentials.AccessToken |
close
close() -> None
get_token
The value of the configured token. :param any scopes: Scopes to be added to the token. :return: AccessToken :rtype: ~azure.core.credentials.AccessToken
get_token(*scopes, **kwargs)