Path: blob/main/extensions/microsoft-authentication/src/common/publicClientCache.ts
5242 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, DeviceCodeRequest } 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>;12acquireTokenByDeviceCode(request: Omit<DeviceCodeRequest, 'deviceCodeCallback'>): Promise<AuthenticationResult | null>;13acquireTokenByRefreshToken(request: RefreshTokenRequest): Promise<AuthenticationResult | null>;14removeAccount(account: AccountInfo): Promise<void>;15accounts: AccountInfo[];16clientId: string;17isBrokerAvailable: Readonly<boolean>;18}1920export interface ICachedPublicClientApplicationManager {21onDidAccountsChange: Event<{ added: AccountInfo[]; changed: AccountInfo[]; deleted: AccountInfo[] }>;22getOrCreate(clientId: string, migrate?: { refreshTokensToMigrate?: string[]; tenant: string }): Promise<ICachedPublicClientApplication>;23getAll(): ICachedPublicClientApplication[];24}252627