Share via


BotFrameworkAdapter.GetUserTokenAsync Method

Definition

Overloads

GetUserTokenAsync(ITurnContext, AppCredentials, String, String, CancellationToken)

Attempts to retrieve the token for a user that's in a login flow, using customized AppCredentials.

GetUserTokenAsync(ITurnContext, String, String, CancellationToken)

Attempts to retrieve the token for a user that's in a login flow, using the bot's AppCredentials.

GetUserTokenAsync(ITurnContext, AppCredentials, String, String, CancellationToken)

Attempts to retrieve the token for a user that's in a login flow, using customized AppCredentials.

public virtual System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse> GetUserTokenAsync (Microsoft.Bot.Builder.ITurnContext turnContext, Microsoft.Bot.Connector.Authentication.AppCredentials oAuthAppCredentials, string connectionName, string magicCode, System.Threading.CancellationToken cancellationToken = default);
abstract member GetUserTokenAsync : Microsoft.Bot.Builder.ITurnContext * Microsoft.Bot.Connector.Authentication.AppCredentials * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
override this.GetUserTokenAsync : Microsoft.Bot.Builder.ITurnContext * Microsoft.Bot.Connector.Authentication.AppCredentials * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
Public Overridable Function GetUserTokenAsync (turnContext As ITurnContext, oAuthAppCredentials As AppCredentials, connectionName As String, magicCode As String, 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.

magicCode
String

(Optional) Optional user entered code to validate.

cancellationToken
CancellationToken

Cancellation token.

Returns

Token Response.

Implements

Applies to

GetUserTokenAsync(ITurnContext, String, String, CancellationToken)

Attempts to retrieve the token for a user that's in a login flow, using the bot's AppCredentials.

public virtual System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse> GetUserTokenAsync (Microsoft.Bot.Builder.ITurnContext turnContext, string connectionName, string magicCode, System.Threading.CancellationToken cancellationToken = default);
abstract member GetUserTokenAsync : Microsoft.Bot.Builder.ITurnContext * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
override this.GetUserTokenAsync : Microsoft.Bot.Builder.ITurnContext * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
Public Overridable Function GetUserTokenAsync (turnContext As ITurnContext, connectionName As String, magicCode As String, 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.

magicCode
String

(Optional) Optional user entered code to validate.

cancellationToken
CancellationToken

Cancellation token.

Returns

Token Response.

Implements

Applies to