IExtendedUserTokenProvider.GetAadTokensAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves Azure Active Directory tokens for particular resources on a configured connection, using customized AppCredentials.
public 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>>
Public 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))
Parameters
- context
- ITurnContext
Context for the current turn of conversation with the user.
- oAuthAppCredentials
- AppCredentials
AppCredentials for OAuth.
- connectionName
- String
The name of the Azure Active Directory connection configured with this bot.
- resourceUrls
- String[]
The list of resource URLs to retrieve tokens for.
- userId
- String
The user Id for which tokens are retrieved. If passing in null the userId is taken from the Activity in the ITurnContext.
- cancellationToken
- CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
Dictionary of resourceUrl to the corresponding TokenResponse.