Language

UserTokenClient.GetTokenAsync Method

Definition

Gets the user token for a particular connection.

public virtual System.Threading.Tasks.Task<Microsoft.Teams.Core.GetTokenResult?> GetTokenAsync(string userId, string connectionName, string channelId, string? code = default, Microsoft.Teams.Core.Http.BotRequestContext? requestContext = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetTokenAsync : string * string * string * string * Microsoft.Teams.Core.Http.BotRequestContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Teams.Core.GetTokenResult>
override this.GetTokenAsync : string * string * string * string * Microsoft.Teams.Core.Http.BotRequestContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Teams.Core.GetTokenResult>
Public Overridable Function GetTokenAsync (userId As String, connectionName As String, channelId As String, Optional code As String = Nothing, Optional requestContext As BotRequestContext = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of GetTokenResult)

Parameters

userId
String

The user ID.

connectionName
String

The connection name.

channelId
String

The channel ID.

code
String

The optional code.

requestContext
BotRequestContext

Optional per-request properties used for authentication.

cancellationToken
CancellationToken

The cancellation token.

Returns

A task that represents the asynchronous operation. The result contains the token, or null if no token is available.

Applies to