IChannelServiceClientFactory.CreateUserTokenClientAsync Method

Definition

Creates the appropriate IUserTokenClient instance.

public System.Threading.Tasks.Task<Microsoft.Agents.Connector.IUserTokenClient> CreateUserTokenClientAsync(System.Security.Claims.ClaimsIdentity claimsIdentity, bool? useAnonymous = False, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateUserTokenClientAsync : System.Security.Claims.ClaimsIdentity * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Connector.IUserTokenClient>
Public Function CreateUserTokenClientAsync (claimsIdentity As ClaimsIdentity, Optional useAnonymous As Nullable(Of Boolean) = False, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IUserTokenClient)

Parameters

claimsIdentity
ClaimsIdentity

The inbound Activity's ClaimsIdentity.

useAnonymous
Nullable<Boolean>

Whether to use anonymous credentials.

cancellationToken
CancellationToken

A cancellation token.

Returns

Asynchronous Task with IUserTokenClient instance.

Remarks

This normally wouldn't be called directly by an Agent developer, but rather is used internally by a IChannelAdapter to create the client needed to communicate with the Azure Bot Token Service. This is called at the beginning of each turn. The Agent developer can get a turn appropriate IUserTokenClient by calling turnContext.Services.Get<IUserTokenClient>().

Applies to