Language

SharePointSSOTokenExchangeMiddleware Class

Definition

If the activity name is cardExtension/token, this middleware will attempt to exchange the token, and deduplicate the incoming call, ensuring only one exchange request is processed.

public class SharePointSSOTokenExchangeMiddleware
type SharePointSSOTokenExchangeMiddleware = class
Public Class SharePointSSOTokenExchangeMiddleware
Inheritance
SharePointSSOTokenExchangeMiddleware

Remarks

If a user is signed into multiple devices, the Agent could receive a "signin/tokenExchange" from each client. Each token exchange request for a specific user login will have an identical Activity.Value.Id.

Only one of these token exchange requests should be processed by the Agent. The others return PreconditionFailed. For a distributed Agent in production, this requires a distributed storage ensuring only one token exchange is processed. This middleware supports CosmosDb storage found in Microsoft.Agents.Storage.CosmosDb, or MemoryStorage for local development. IStorage's ETag implementation for token exchange activity deduplication.

Constructors

Name Description
SharePointSSOTokenExchangeMiddleware(IStorage, String)

Initializes a new instance of the SharePointSSOTokenExchangeMiddleware class.

Methods

Name Description
OnTurnAsync(ITurnContext, CancellationToken)

Handles a turn.

Applies to