TeamsSSOTokenExchangeMiddleware Class
If the activity name is signin/tokenExchange, self middleware will attempt to exchange the token, and deduplicate the incoming call, ensuring only one exchange request is processed.
Initializes a instance of the class.
sign on token exchange.
- Inheritance
-
TeamsSSOTokenExchangeMiddleware
Constructor
TeamsSSOTokenExchangeMiddleware(storage: Storage, connection_name: str)
Parameters
Name | Description |
---|---|
storage
Required
|
The Storage to use for deduplication. |
connection_name
Required
|
The connection name to use for the single |
Remarks
If a user is signed into multiple Teams clients, the Bot 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 bot. The others return . For a distributed bot in production, self requires a distributed storage ensuring only one token exchange is processed. self middleware supports CosmosDb storage found in Microsoft.Bot.Builder.Azure, or MemoryStorage for local development. IStorage's ETag implementation for token exchange activity deduplication.
Methods
on_turn |
on_turn
async on_turn(context: TurnContext, logic: Callable[[TurnContext], Awaitable])
Parameters
Name | Description |
---|---|
context
Required
|
|
logic
Required
|
|
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for