Interface IChannelServiceClientFactory
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
ClaimsIdentityThe inbound Activity's ClaimsIdentity.
serviceUrl
stringThe service URL.
audience
stringcancellationToken
CancellationTokenA cancellation token.
scopes
IList<string>The scopes to request.
useAnonymous
boolWhether 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
ClaimsIdentityThe inbound Activity's ClaimsIdentity.
cancellationToken
CancellationTokenA cancellation token.
useAnonymous
boolWhether to use anonymous credentials.
Returns
- Task<IUserTokenClient>
Asynchronous Task with Microsoft.Agents.Connector.IUserTokenClient instance.