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
使用此 Bot 設定的 Azure Active Directory 連線名稱。
- resourceUrls
- String[]
要為其擷取令牌的資源URL清單。
- userId
- String
擷取令牌的使用者標識碼。 如果傳入 null,則 userId 會取自 ITurnContext 中的 Activity。
- cancellationToken
- CancellationToken
一種可被其他物件或執行緒用來接收取消通知的取消標記。
傳回
resourceUrl 字典至對應的 TokenResponse。