Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Identity] Refactor MSAL Browser Flow #32060

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ import {
} from "../util/tenantIdUtils.js";

import type { AuthenticationRecord } from "../msal/types.js";
import { MSALAuthCode } from "../msal/browserFlows/msalAuthCode.js";
import type { MsalBrowserFlowOptions } from "../msal/browserFlows/msalBrowserCommon.js";
import type { MsalFlow } from "../msal/browserFlows/flows.js";
import type { MsalBrowserClient, MsalBrowserFlowOptions } from "../msal/browserFlows/msalBrowserCommon.js";
import { ensureScopes } from "../util/scopeUtils.js";
import { tracingClient } from "../util/tracing.js";
import { createMsalBrowserClient } from "../msal/browserFlows/msalAuthCode.js";

const logger = credentialLogger("InteractiveBrowserCredential");

Expand All @@ -28,7 +27,7 @@ const logger = credentialLogger("InteractiveBrowserCredential");
export class InteractiveBrowserCredential implements TokenCredential {
private tenantId?: string;
private additionallyAllowedTenantIds: string[];
private msalFlow: MsalFlow;
private msalFlow: MsalBrowserClient;
private disableAutomaticAuthentication?: boolean;

/**
Expand Down Expand Up @@ -84,7 +83,7 @@ export class InteractiveBrowserCredential implements TokenCredential {
typeof options.redirectUri === "function" ? options.redirectUri() : options.redirectUri,
};

this.msalFlow = new MSALAuthCode(msalOptions);
this.msalFlow = createMsalBrowserClient(msalOptions);
this.disableAutomaticAuthentication = options?.disableAutomaticAuthentication;
}

Expand Down
46 changes: 0 additions & 46 deletions sdk/identity/identity/src/msal/browserFlows/flows.ts

This file was deleted.

Loading
Loading