aimpress-chatbot/node_modules/botbuilder/lib/sharepoint/sharePointSSOTokenExchangeMiddleware.d.ts
“SamoilenkoVadym” 55445dbc86
Some checks failed
Build and deploy Node.js app to Azure Web App - ChatBot2222 / build (push) Has been cancelled
Build and deploy Node.js app to Azure Web App - ChatBot2222 / deploy (push) Has been cancelled
Deploy bot to Azure
2025-04-27 19:55:19 +01:00

37 lines
No EOL
1.9 KiB
TypeScript

import { Middleware, Storage, TurnContext } from 'botbuilder-core';
/**
* 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.
*
* If a user is signed into multiple devices, the Bot could receive a
* "cardExtension/token" from each device. 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 [StatusCodes.PRECONDITION_FAILED](xref:botframework-schema:StatusCodes.PRECONDITION_FAILED).
* For a distributed bot in production, this requires distributed storage
* ensuring only one token exchange is processed. This middleware supports
* CosmosDb storage found in botbuilder-azure, or MemoryStorage for local development.
*/
export declare class SharePointSSOTokenExchangeMiddleware implements Middleware {
private readonly storage;
private readonly oAuthConnectionName;
/**
* Initializes a new instance of the SharePointSSOTokenExchangeMiddleware class.
*
* @param storage The [Storage](xref:botbuilder-core.Storage) to use for deduplication
* @param oAuthConnectionName The connection name to use for the single sign on token exchange
*/
constructor(storage: Storage, oAuthConnectionName: string);
/**
* Called each time the bot receives a new request.
*
* @param context Context for current turn of conversation with the user.
* @param _next Function to call to continue execution to the next step in the middleware chain.
*/
onTurn(context: TurnContext, _next: () => Promise<void>): Promise<void>;
private deduplicatedTokenExchangeId;
private exchangedToken;
}
//# sourceMappingURL=sharePointSSOTokenExchangeMiddleware.d.ts.map