BotFrameworkAdapter.GetAadTokensAsync 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| GetAadTokensAsync(ITurnContext, String, String[], String, CancellationToken) |
利用機器人的 AppCredentials 取得設定連線中特定資源的 Azure Active Directory 令牌。 |
| GetAadTokensAsync(ITurnContext, AppCredentials, String, String[], String, CancellationToken) |
使用自定義的 AppCredentials,擷取已設定連線上特定資源的 Azure Active Directory 令牌。 |
GetAadTokensAsync(ITurnContext, String, String[], String, CancellationToken)
利用機器人的 AppCredentials 取得設定連線中特定資源的 Azure Active Directory 令牌。
public virtual 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>>
override this.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 Overridable 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。
實作
適用於
GetAadTokensAsync(ITurnContext, AppCredentials, String, String[], String, CancellationToken)
使用自定義的 AppCredentials,擷取已設定連線上特定資源的 Azure Active Directory 令牌。
public virtual System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string,Microsoft.Bot.Schema.TokenResponse>> GetAadTokensAsync(Microsoft.Bot.Builder.ITurnContext context, Microsoft.Bot.Connector.Authentication.AppCredentials oAuthAppCredentials, string connectionName, string[] resourceUrls, string userId = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAadTokensAsync : Microsoft.Bot.Builder.ITurnContext * Microsoft.Bot.Connector.Authentication.AppCredentials * string * string[] * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, Microsoft.Bot.Schema.TokenResponse>>
override this.GetAadTokensAsync : Microsoft.Bot.Builder.ITurnContext * Microsoft.Bot.Connector.Authentication.AppCredentials * string * string[] * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, Microsoft.Bot.Schema.TokenResponse>>
Public Overridable Function GetAadTokensAsync (context As ITurnContext, oAuthAppCredentials As AppCredentials, 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
目前與使用者交談回合的內容。
- oAuthAppCredentials
- AppCredentials
適用於 OAuth 的 AppCredentials。
- connectionName
- String
使用此 Bot 設定的 Azure Active Directory 連線名稱。
- resourceUrls
- String[]
要為其擷取令牌的資源URL清單。
- userId
- String
擷取令牌的使用者標識碼。 如果傳入 null,則 userId 會取自 ITurnContext 中的 Activity。
- cancellationToken
- CancellationToken
非同步操作取消令牌。
傳回
resourceUrl 字典至對應的 TokenResponse。