IUserTokenProvider.GetAadTokensAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用机器人的 AppCredentials 检索已配置连接上特定资源的 Azure Active Directory 令牌。
public System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string,Microsoft.Bot.Schema.TokenResponse>> GetAadTokensAsync(Microsoft.Bot.Builder.ITurnContext context, string connectionName, string[] resourceUrls, string userId = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAadTokensAsync : Microsoft.Bot.Builder.ITurnContext * string * string[] * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, Microsoft.Bot.Schema.TokenResponse>>
Public Function GetAadTokensAsync (context As ITurnContext, connectionName As String, resourceUrls As String(), Optional userId As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Dictionary(Of String, TokenResponse))
参数
- context
- ITurnContext
与用户当前轮次聊天的上下文。
- connectionName
- String
使用此机器人配置的 Azure Active Directory 连接的名称。
- resourceUrls
- String[]
要为其检索令牌的资源 URL 的列表。
- userId
- String
要为其检索令牌的用户 ID。 如果传入 null,则 userId 取自 ITurnContext 中的 Activity。
- cancellationToken
- CancellationToken
可由其他对象或线程用以接收取消通知的取消标记。
返回
resourceUrl 到相应 TokenResponse 的字典。