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

Support COOP same-origin-allow-popups #7408

Open
wants to merge 4 commits into
base: popup-coop-sample
Choose a base branch
from

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

@@ -58,6 +58,7 @@ export type PopupParams = {
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!

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants