Skip to content

Conversation

@sameerag
Copy link
Member

@sameerag sameerag commented Dec 2, 2025

This pull request:

  • Introduces support for configuring DOM API usage for platform broker authentication in MSAL.js, specifically targeting Edge browser environments.
  • Updates documentation to clarify platform broker support across Windows and Mac, adds a new configuration flag (allowPlatformBrokerWithDOM), and introduces validation to prevent misconfiguration.
  • Error handling and messaging are also improved for invalid configuration scenarios.

@sameerag sameerag marked this pull request as ready for review December 3, 2025 08:35
@sameerag sameerag requested a review from a team as a code owner December 3, 2025 08:35
Copilot AI review requested due to automatic review settings December 3, 2025 08:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces support for platform broker authentication via DOM APIs in Edge browser, allowing direct communication with the platform broker without requiring a browser extension. The PR adds a new allowPlatformBrokerWithDOM configuration flag, includes validation to ensure it's only enabled when allowPlatformBroker is also enabled, and updates documentation to reflect these changes.

Key changes:

  • Adds allowPlatformBrokerWithDOM configuration flag with validation that prevents enabling it without allowPlatformBroker
  • Refactors PlatformAuthProvider to accept DOM support as a parameter instead of reading from session storage, removing the deprecated isDomEnabledForPlatformAuth() method
  • Updates documentation to clarify platform broker support across Windows/Mac and describes the new Edge DOM API feature

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/msal-common/src/error/ClientConfigurationErrorCodes.ts Adds error code for invalid platform broker configuration
lib/msal-common/src/error/ClientConfigurationError.ts Adds error message for the new configuration validation error
lib/msal-browser/test/broker/PlatformAuthProvider.spec.ts Updates tests to pass DOM config as parameter instead of using session storage; removes deprecated tests
lib/msal-browser/test/app/PublicClientApplication.spec.ts Updates test to use new allowPlatformBrokerWithDOM flag instead of session storage
lib/msal-browser/src/controllers/StandardController.ts Passes allowPlatformBrokerWithDOM config to platform provider initialization
lib/msal-browser/src/config/Configuration.ts Defines the new allowPlatformBrokerWithDOM configuration option with default value
lib/msal-browser/src/broker/nativeBroker/PlatformAuthProvider.ts Refactors to accept DOM support as parameter, adds configuration validation, removes deprecated session storage method
lib/msal-browser/docs/device-bound-tokens.md Updates documentation to clarify platform broker support and adds new section for DOM API configuration
change/@azure-msal-common-c8d42435-3b15-43cc-9cce-19f00d77e61e.json Beachball changefile for msal-common package
change/@azure-msal-browser-bdb9bd60-08c2-4532-b0cd-2b9830ffa03f.json Beachball changefile for msal-browser package

sameerag and others added 2 commits December 3, 2025 00:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Dec 3, 2025

@sameerag I've opened a new pull request, #8172, to work on those changes. Once the pull request is ready, I'll request review from you.

sameerag and others added 3 commits December 3, 2025 00:55
…8172)

- [x] Add test coverage for configuration validation error when
allowPlatformBrokerWithDOM is enabled without allowPlatformBroker
- [x] Import ClientConfigurationErrorCodes in test file
- [x] Verify test passes and linter passes

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sameerag <21958742+sameerag@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Dec 3, 2025

@sameerag I've opened a new pull request, #8173, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Dec 3, 2025

@sameerag I've opened a new pull request, #8174, to work on those changes. Once the pull request is ready, I'll request review from you.

@sameerag sameerag enabled auto-merge (squash) December 3, 2025 17:28
@sameerag sameerag merged commit bbc64c9 into dev Dec 3, 2025
8 checks passed
@sameerag sameerag deleted the enable-dom branch December 3, 2025 19:43
Copilot AI added a commit that referenced this pull request Dec 3, 2025
- Add allowPlatformBrokerWithDOM configuration flag
- Update isPlatformBrokerAvailable to require domConfig as first parameter
- Remove deprecated isDomEnabledForPlatformAuth function
- Add error validation for invalid platform broker configuration
- Update documentation with platform broker terminology and DOM API support

Co-authored-by: sameerag <21958742+sameerag@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants