Share via


OAuthPrompt.GetUserTokenAsync(ITurnContext, CancellationToken) Method

Definition

Attempts to get the user's token.

public System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse> GetUserTokenAsync (Microsoft.Bot.Builder.ITurnContext turnContext, System.Threading.CancellationToken cancellationToken = default);
member this.GetUserTokenAsync : Microsoft.Bot.Builder.ITurnContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
Public Function GetUserTokenAsync (turnContext As ITurnContext, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TokenResponse)

Parameters

turnContext
ITurnContext

Context for the current turn of conversation with the user.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

Remarks

If the task is successful and user already has a token or the user successfully signs in, the result contains the user's token.

Applies to