Detach authority/tenant from the PublicClientApp (#242719)

everything
This commit is contained in:
Tyler James Leonhardt
2025-03-05 10:55:10 -08:00
committed by GitHub
parent c790f5e777
commit 95ab795ff0
7 changed files with 251 additions and 111 deletions

View File

@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type { AccountInfo, AuthenticationResult, InteractiveRequest, SilentFlowRequest } from '@azure/msal-node';
import type { AccountInfo, AuthenticationResult, InteractiveRequest, RefreshTokenRequest, SilentFlowRequest } from '@azure/msal-node';
import type { Disposable, Event } from 'vscode';
export interface ICachedPublicClientApplication extends Disposable {
@@ -11,14 +11,14 @@ export interface ICachedPublicClientApplication extends Disposable {
onDidRemoveLastAccount: Event<void>;
acquireTokenSilent(request: SilentFlowRequest): Promise<AuthenticationResult>;
acquireTokenInteractive(request: InteractiveRequest): Promise<AuthenticationResult>;
acquireTokenByRefreshToken(request: RefreshTokenRequest): Promise<AuthenticationResult | null>;
removeAccount(account: AccountInfo): Promise<void>;
accounts: AccountInfo[];
clientId: string;
authority: string;
}
export interface ICachedPublicClientApplicationManager {
onDidAccountsChange: Event<{ added: AccountInfo[]; changed: AccountInfo[]; deleted: AccountInfo[] }>;
getOrCreate(clientId: string, authority: string): Promise<ICachedPublicClientApplication>;
getOrCreate(clientId: string, refreshTokensToMigrate?: string[]): Promise<ICachedPublicClientApplication>;
getAll(): ICachedPublicClientApplication[];
}