/** * File-backed store for Bot Framework OAuth SSO tokens. * * Tokens are keyed by (connectionName, userId). `userId` should be the * stable AAD object ID (`activity.from.aadObjectId`) when available, * falling back to the Bot Framework `activity.from.id`. * * The store is intentionally minimal: it persists the exchanged user * token plus its expiration so consumers (for example tool handlers * that call Microsoft Graph with delegated permissions) can fetch a * valid token without reaching back into Bot Framework every turn.
*/
import { resolveMSTeamsStorePath } from "./storage.js"; import { readJsonFile, withFileLock, writeJsonFile } from "./store-fs.js";
export type MSTeamsSsoStoredToken = { /** Connection name from the Bot Framework OAuth connection setting. */
connectionName: string; /** Stable user identifier (AAD object ID preferred). */
userId: string; /** Exchanged user access token. */
token: string; /** Expiration (ISO 8601) when the Bot Framework user token service reports one. */
expiresAt?: string; /** ISO 8601 timestamp for the last successful exchange. */
updatedAt: string;
};
type SsoStoreData = {
version: 1; // Keyed by `${connectionName}::${userId}` for a simple flat map on disk.
tokens: Record<string, MSTeamsSsoStoredToken>;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.