BotFrameworkAdapter.ExchangeTokenAsync 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.
Overloads
ExchangeTokenAsync(ITurnContext, String, String, TokenExchangeRequest, CancellationToken) |
Performs a token exchange operation such as for single sign-on. |
ExchangeTokenAsync(ITurnContext, AppCredentials, String, String, TokenExchangeRequest, CancellationToken) |
Performs a token exchange operation such as for single sign-on. |
ExchangeTokenAsync(ITurnContext, String, String, TokenExchangeRequest, CancellationToken)
Performs a token exchange operation such as for single sign-on.
public virtual System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse> ExchangeTokenAsync (Microsoft.Bot.Builder.ITurnContext turnContext, string connectionName, string userId, Microsoft.Bot.Schema.TokenExchangeRequest exchangeRequest, System.Threading.CancellationToken cancellationToken = default);
abstract member ExchangeTokenAsync : Microsoft.Bot.Builder.ITurnContext * string * string * Microsoft.Bot.Schema.TokenExchangeRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
override this.ExchangeTokenAsync : Microsoft.Bot.Builder.ITurnContext * string * string * Microsoft.Bot.Schema.TokenExchangeRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
Public Overridable Function ExchangeTokenAsync (turnContext As ITurnContext, connectionName As String, userId As String, exchangeRequest As TokenExchangeRequest, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TokenResponse)
Parameters
- turnContext
- ITurnContext
Context for the current turn of conversation with the user.
- connectionName
- String
Name of the auth connection to use.
- userId
- String
The user id associated with the token..
- exchangeRequest
- TokenExchangeRequest
The exchange request details, either a token to exchange or a uri to exchange.
- cancellationToken
- CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
If the task completes, the exchanged token is returned.
Implements
Applies to
ExchangeTokenAsync(ITurnContext, AppCredentials, String, String, TokenExchangeRequest, CancellationToken)
Performs a token exchange operation such as for single sign-on.
public virtual System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse> ExchangeTokenAsync (Microsoft.Bot.Builder.ITurnContext turnContext, Microsoft.Bot.Connector.Authentication.AppCredentials oAuthAppCredentials, string connectionName, string userId, Microsoft.Bot.Schema.TokenExchangeRequest exchangeRequest, System.Threading.CancellationToken cancellationToken = default);
abstract member ExchangeTokenAsync : Microsoft.Bot.Builder.ITurnContext * Microsoft.Bot.Connector.Authentication.AppCredentials * string * string * Microsoft.Bot.Schema.TokenExchangeRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
override this.ExchangeTokenAsync : Microsoft.Bot.Builder.ITurnContext * Microsoft.Bot.Connector.Authentication.AppCredentials * string * string * Microsoft.Bot.Schema.TokenExchangeRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
Public Overridable Function ExchangeTokenAsync (turnContext As ITurnContext, oAuthAppCredentials As AppCredentials, connectionName As String, userId As String, exchangeRequest As TokenExchangeRequest, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TokenResponse)
Parameters
- turnContext
- ITurnContext
Context for the current turn of conversation with the user.
- oAuthAppCredentials
- AppCredentials
AppCredentials for OAuth.
- connectionName
- String
Name of the auth connection to use.
- userId
- String
The user id associated with the token..
- exchangeRequest
- TokenExchangeRequest
The exchange request details, either a token to exchange or a uri to exchange.
- cancellationToken
- CancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
If the task completes, the exchanged token is returned.