Skip to content

Support COOP same-origin-allow-popups#7408

Open
vickiez wants to merge 4 commits intoAzureAD:popup-coop-samplefrom
vickiez:popup-coop-fix
Open

Support COOP same-origin-allow-popups#7408
vickiez wants to merge 4 commits intoAzureAD:popup-coop-samplefrom
vickiez:popup-coop-fix

Conversation

@vickiez
Copy link

@vickiez vickiez commented Nov 7, 2024

Example of using BroadcastChannel to communicate between the same origin across browsing contexts, enabling popup auth flow when the app has a cross-origin opener policy of "same-origin-allow-popups"

*The final solution should ensure the correct InteractionType is used for redirects vs popups and should handle the case where popup window is closed by user

export class PopupClient extends StandardInteractionClient {
private currentWindow: Window | undefined;
protected nativeStorage: BrowserCacheManager;
private authChannel: BroadcastChannel;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like BroadcastChannel is well supported (https://caniuse.com/broadcastchannel) although not sure if this PopupClient.ts code needs to run in super old contexts. If so, they might want to check if BroadcastChannel doesn't exist and fallback to their URI change polling code. But if this is demo fix for them then probably none of that is necessary anyway

Copy link

@david-risney david-risney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg!

@microsoft-github-policy-service
Copy link
Contributor

Reminder: This PR appears to be stale. If this PR is still a work in progress please mark as draft.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

msal-browser Related to msal-browser package Needs: Attention 👋 Awaiting response from the MSAL.js team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants