Path: blob/main/extensions/microsoft-authentication/src/common/publicClientCache.ts
3320 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/4import type { AccountInfo, AuthenticationResult, InteractiveRequest, RefreshTokenRequest, SilentFlowRequest } from '@azure/msal-node';5import type { Disposable, Event } from 'vscode';67export interface ICachedPublicClientApplication {8onDidAccountsChange: Event<{ added: AccountInfo[]; changed: AccountInfo[]; deleted: AccountInfo[] }>;9onDidRemoveLastAccount: Event<void>;10acquireTokenSilent(request: SilentFlowRequest): Promise<AuthenticationResult>;11acquireTokenInteractive(request: InteractiveRequest): Promise<AuthenticationResult>;12acquireTokenByRefreshToken(request: RefreshTokenRequest): Promise<AuthenticationResult | null>;13removeAccount(account: AccountInfo): Promise<void>;14accounts: AccountInfo[];15clientId: string;16isBrokerAvailable: Readonly<boolean>;17}1819export interface ICachedPublicClientApplicationManager {20onDidAccountsChange: Event<{ added: AccountInfo[]; changed: AccountInfo[]; deleted: AccountInfo[] }>;21getOrCreate(clientId: string, migrate?: { refreshTokensToMigrate?: string[]; tenant: string }): Promise<ICachedPublicClientApplication>;22getAll(): ICachedPublicClientApplication[];23}242526