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