Table of Contents

Interface IChannelServiceClientFactory

Namespace
Microsoft.Agents.Builder
Assembly
Microsoft.Agents.Builder.dll

Handles creation of IConnectorClient and IUserTokenClient objects for use when handling incoming Activities.

public interface IChannelServiceClientFactory

Remarks

This is not something normally used or implemented by an Agent developer. Rather it is used internally by the IChannelAdapter to create the clients need to communicate back the sender.

Methods

CreateConnectorClientAsync(ClaimsIdentity, string, string, CancellationToken, IList<string>, bool)

Creates a Microsoft.Agents.Connector.IConnectorClient that can be used to create Microsoft.Agents.Connector.IConnectorClient.

Task<IConnectorClient> CreateConnectorClientAsync(ClaimsIdentity claimsIdentity, string serviceUrl, string audience, CancellationToken cancellationToken, IList<string> scopes = null, bool useAnonymous = false)

Parameters

claimsIdentity ClaimsIdentity

The inbound Activity's ClaimsIdentity.

serviceUrl string

The service URL.

audience string
cancellationToken CancellationToken

A cancellation token.

scopes IList<string>

The scopes to request.

useAnonymous bool

Whether to use anonymous credentials.

Returns

Task<IConnectorClient>

A Microsoft.Agents.Connector.IConnectorClient.

Remarks

This is called at the beginning of each turn.

CreateUserTokenClientAsync(ClaimsIdentity, CancellationToken, bool)

Creates the appropriate Microsoft.Agents.Connector.IUserTokenClient instance.

Task<IUserTokenClient> CreateUserTokenClientAsync(ClaimsIdentity claimsIdentity, CancellationToken cancellationToken, bool useAnonymous = false)

Parameters

claimsIdentity ClaimsIdentity

The inbound Activity's ClaimsIdentity.

cancellationToken CancellationToken

A cancellation token.

useAnonymous bool

Whether to use anonymous credentials.

Returns

Task<IUserTokenClient>

Asynchronous Task with Microsoft.Agents.Connector.IUserTokenClient instance.