Skip to content

Commit b7960e6

Browse files
authored
Merge branch 'msal-v5' into akaliugonna/port-change-to-msalv5
2 parents d4cc454 + 29b2daf commit b7960e6

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Add allow=\"local-network-access *\" attribute to iframe for Chrome 142 compatibility [#8132](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/8132)",
4+
"packageName": "@azure/msal-browser",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

lib/msal-browser/src/interaction_handler/SilentHandler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ function createHiddenIframe(): HTMLIFrameElement {
200200
"sandbox",
201201
"allow-scripts allow-same-origin allow-forms"
202202
);
203+
authFrame.setAttribute("allow", "local-network-access *");
203204
document.body.appendChild(authFrame);
204205

205206
return authFrame;

lib/msal-browser/test/interaction_handler/SilentHandler.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ describe("SilentHandler.ts Unit Tests", () => {
6161
);
6262
expect(authFrame instanceof HTMLIFrameElement).toBe(true);
6363
});
64+
65+
it("Sets the allow attribute for local network access on iframe", async () => {
66+
const authFrame = await SilentHandler.initiateCodeRequest(
67+
testNavUrl,
68+
performanceClient,
69+
browserRequestLogger,
70+
RANDOM_TEST_GUID
71+
);
72+
expect(authFrame.getAttribute("allow")).toBe(
73+
"local-network-access *"
74+
);
75+
});
6476
});
6577

6678
describe("monitorIframeForHash", () => {

0 commit comments

Comments
 (0)