@microsoft/teams-ai
Version:
SDK focused on building AI based applications for Microsoft Teams.
70 lines • 3.89 kB
TypeScript
import { Storage, TokenResponse, TurnContext } from 'botbuilder';
import { DialogTurnResult } from 'botbuilder-dialogs';
import { Application } from '../Application';
import { TurnState } from '../TurnState';
import { BotAuthenticationBase } from './BotAuthenticationBase';
import { ConfidentialClientApplication } from '@azure/msal-node';
import { TeamsSsoSettings } from './TeamsSsoSettings';
/**
* @internal
*
* Handles authentication for Teams bots using Single Sign-On (SSO).
* @template TState - The type of the turn state object.
*/
export declare class TeamsSsoBotAuthentication<TState extends TurnState> extends BotAuthenticationBase<TState> {
private _prompt;
private _tokenExchangeIdRegex;
/**
* Initializes a new instance of the TeamsSsoBotAuthentication class.
* @param {Application<TState>} app - The application object.
* @param {TeamsSsoSettings} settings - The settings for Teams SSO.
* @param {string} settingName - The name of the setting.
* @param {ConfidentialClientApplication} msal - The MSAL (Microsoft Authentication Library) object.
* @param {Storage} storage - The storage object for storing state.
*/
constructor(app: Application<TState>, settings: TeamsSsoSettings, settingName: string, msal: ConfidentialClientApplication, storage?: Storage);
/**
* Run or continue the SSO dialog and returns the result.
* @param {TurnContext} context - The turn context object.
* @param {TState} state - The turn state object.
* @param {string} dialogStateProperty - The name of the dialog state property.
* @returns {Promise<DialogTurnResult<TokenResponse>>} A promise that resolves to the dialog turn result containing the token response.
*/
runDialog(context: TurnContext, state: TState, dialogStateProperty: string): Promise<DialogTurnResult<TokenResponse>>;
/**
* Continues the SSO dialog and returns the result.
* @param {TurnContext} context - The turn context object.
* @param {TState} state - The turn state object.
* @param {string} dialogStateProperty - The name of the dialog state property.
* @returns {Promise<DialogTurnResult<TokenResponse>>} A promise that resolves to the dialog turn result containing the token response.
*/
continueDialog(context: TurnContext, state: TState, dialogStateProperty: string): Promise<DialogTurnResult<TokenResponse>>;
/**
* Determines whether the token exchange activity should be processed by current authentication setting.
* @param {TurnContext} context - The turn context object.
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the token exchange route should be processed by current class instance.
*/
tokenExchangeRouteSelector(context: TurnContext): Promise<boolean>;
/**
* Creates the SSO dialog context.
* @param {TurnContext} context - The turn context object.
* @param {TState} state - The turn state object.
* @param {string} dialogStateProperty - The name of the dialog state property.
* @returns {Promise<DialogContext>} A promise that resolves to the dialog context object.
*/
private createSsoDialogContext;
/**
* Checks if deduplication should be performed for token exchange.
* @param {TurnContext} context - The turn context object.
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether deduplication should be performed.
*/
private shouldDedup;
/**
* Gets the storage key for storing the token exchange state.
* @param {TurnContext} context - The turn context object.
* @returns {string} The storage key.
* @throws Error if the context is invalid or the activity is not a token exchange invoke.
*/
private getStorageKey;
}
//# sourceMappingURL=TeamsSsoBotAuthentication.d.ts.map