你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

AzureCommunicationTokenCredential class

支持主动令牌刷新的 CommunicationTokenCredential 实现。

构造函数

AzureCommunicationTokenCredential(CommunicationTokenRefreshOptions)

使用 lambda 创建 CommunicationTokenCredential 实例,以获取令牌和配置主动刷新的选项。

AzureCommunicationTokenCredential(string)

创建具有静态令牌且不主动刷新的 CommunicationTokenCredential 实例。

方法

dispose()

释放 CommunicationTokenCredential 并取消任何内部自动刷新操作。

getToken(CommunicationGetTokenOptions)

AccessToken获取用户的 。 如果已释放,则引发 。

构造函数详细信息

AzureCommunicationTokenCredential(CommunicationTokenRefreshOptions)

使用 lambda 创建 CommunicationTokenCredential 实例,以获取令牌和配置主动刷新的选项。

new AzureCommunicationTokenCredential(refreshOptions: CommunicationTokenRefreshOptions)

参数

refreshOptions
CommunicationTokenRefreshOptions

用于配置刷新和选择加入主动刷新的选项。

AzureCommunicationTokenCredential(string)

创建具有静态令牌且不主动刷新的 CommunicationTokenCredential 实例。

new AzureCommunicationTokenCredential(token: string)

参数

token

string

通信服务颁发的用户访问令牌。

方法详细信息

dispose()

释放 CommunicationTokenCredential 并取消任何内部自动刷新操作。

function dispose()

getToken(CommunicationGetTokenOptions)

AccessToken获取用户的 。 如果已释放,则引发 。

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

参数

返回

Promise<AccessToken>