Language

OAuthFlow.GetTokenAsync<TActivity> Method

Definition

Attempt silent token acquisition from the Bot Framework Token Store.

public System.Threading.Tasks.Task<string?> GetTokenAsync<TActivity>(Microsoft.Teams.Apps.Context<TActivity> context, System.Threading.CancellationToken cancellationToken = default) where TActivity : Microsoft.Teams.Apps.Schema.TeamsActivity;
member this.GetTokenAsync : Microsoft.Teams.Apps.Context<'Activity (requires 'Activity :> Microsoft.Teams.Apps.Schema.TeamsActivity)> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string> (requires 'Activity :> Microsoft.Teams.Apps.Schema.TeamsActivity)
Public Function GetTokenAsync(Of TActivity As TeamsActivity) (context As Context(Of TActivity), Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)

Type Parameters

TActivity

The activity type.

Parameters

context
Context<TActivity>

The current turn context.

cancellationToken
CancellationToken

A cancellation token.

Returns

The access token string, or null if no token is cached.

Applies to