Skip to content

Commit e6f44e9

Browse files
Revert "Bugfix - include extra query parameters in ExtraParameters in PlatformAuthRequest" (#8565)
Reverts #8560 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lalimasharda <26092202+lalimasharda@users.noreply.github.com>
1 parent 109a351 commit e6f44e9

4 files changed

Lines changed: 8 additions & 97 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Revert extra query parameters forwarding to native broker [#8565](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/8565)",
4+
"packageName": "@azure/msal-browser",
5+
"email": "copilot@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

change/@azure-msal-browser-60df5ac5-af09-46f9-b318-efaf42240e4a.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

lib/msal-browser/src/interaction_client/PlatformAuthInteractionClient.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -983,8 +983,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
983983
: this.config.auth.clientCapabilities;
984984

985985
// scopes are expected to be received by the native broker as "scope" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.
986-
const { scopes, claims, extraQueryParameters, ...remainingProperties } =
987-
request;
986+
const { scopes, claims, ...remainingProperties } = request;
988987
const scopeSet = new ScopeSet(scopes || []);
989988
scopeSet.appendScopes(Constants.OIDC_DEFAULT_SCOPES);
990989

@@ -1014,7 +1013,6 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
10141013
tokenType: request.authenticationScheme,
10151014
windowTitleSubstring: document.title,
10161015
extraParameters: {
1017-
...extraQueryParameters,
10181016
...request.extraParameters,
10191017
},
10201018
extendedExpiryToken: false, // Make this configurable?

lib/msal-browser/test/interaction_client/PlatformAuthInteractionClient.spec.ts

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -311,93 +311,6 @@ describe("PlatformAuthInteractionClient Tests", () => {
311311
);
312312
});
313313

314-
it("Extension: token request merges extraQueryParameters into extraParameters", async () => {
315-
const sendMessageSpy = jest
316-
.spyOn(PlatformAuthExtensionHandler.prototype, "sendMessage")
317-
.mockImplementation((): Promise<PlatformAuthResponse> => {
318-
return Promise.resolve(MOCK_WAM_RESPONSE);
319-
});
320-
321-
await platformAuthInteractionClient.acquireToken({
322-
scopes: ["User.Read"],
323-
extraQueryParameters: {
324-
testEQP1: "testEQP1",
325-
testEQP2: "testEQP2",
326-
},
327-
extraParameters: {
328-
testEP1: "testEP1",
329-
},
330-
});
331-
332-
expect(sendMessageSpy).toHaveProperty(
333-
"mock.calls[0][0].extraParameters",
334-
{
335-
telemetry: "MATS",
336-
testEQP1: "testEQP1",
337-
testEQP2: "testEQP2",
338-
testEP1: "testEP1",
339-
"x-client-xtra-sku": `${BrowserConstants.MSAL_SKU}|${version},|,|,|`,
340-
}
341-
);
342-
});
343-
344-
it("DOM API: token request merges extraQueryParameters into extraParameters", async () => {
345-
platformAuthDOMHandler = new PlatformAuthDOMHandler(
346-
pca.getLogger(),
347-
getDefaultPerformanceClient(),
348-
"test-correlation-id"
349-
);
350-
351-
const testInteractionClient = new PlatformAuthInteractionClient(
352-
// @ts-ignore
353-
pca.config,
354-
// @ts-ignore
355-
pca.browserStorage,
356-
// @ts-ignore
357-
pca.browserCrypto,
358-
pca.getLogger(),
359-
// @ts-ignore
360-
pca.eventHandler,
361-
// @ts-ignore
362-
pca.navigationClient,
363-
ApiId.acquireTokenRedirect,
364-
perfClient,
365-
platformAuthDOMHandler,
366-
"nativeAccountId",
367-
// @ts-ignore
368-
pca.nativeInternalStorage,
369-
RANDOM_TEST_GUID
370-
);
371-
372-
const sendMessageSpy = jest
373-
.spyOn(PlatformAuthDOMHandler.prototype, "sendMessage")
374-
.mockImplementation((): Promise<PlatformAuthResponse> => {
375-
return Promise.resolve(MOCK_WAM_RESPONSE);
376-
});
377-
378-
await testInteractionClient.acquireToken({
379-
scopes: ["User.Read"],
380-
extraQueryParameters: {
381-
testEQP1: "testEQP1",
382-
testEQP2: "testEQP2",
383-
},
384-
extraParameters: {
385-
testEP1: "testEP1",
386-
},
387-
});
388-
389-
expect(sendMessageSpy).toHaveProperty(
390-
"mock.calls[0][0].extraParameters",
391-
{
392-
telemetry: "MATS",
393-
testEQP1: "testEQP1",
394-
testEQP2: "testEQP2",
395-
testEP1: "testEP1",
396-
"x-client-xtra-sku": `${BrowserConstants.MSAL_SKU}|${version},|,|,|`,
397-
}
398-
);
399-
});
400-
401314
it("DOM API: acquires token successfully", async () => {
402315
platformAuthDOMHandler = new PlatformAuthDOMHandler(
403316
pca.getLogger(),

0 commit comments

Comments
 (0)