Skip to content

[6.1] WAM Broker changes#4387

Draft
cheenamalhotra wants to merge 6 commits into
release/6.1from
dev/cheena/6.1-wam
Draft

[6.1] WAM Broker changes#4387
cheenamalhotra wants to merge 6 commits into
release/6.1from
dev/cheena/6.1-wam

Conversation

@cheenamalhotra

Copy link
Copy Markdown
Member

Ports changes from #4288 to release/6.1 branch.

Copilot AI review requested due to automatic review settings June 19, 2026 16:57
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Jun 19, 2026
@cheenamalhotra cheenamalhotra added this to the 6.1.6 milestone Jun 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Ports WAM broker support for Entra ID authentication flows into the 6.1 release branch, including new configuration and test coverage, plus updates to MSAL dependencies and a WinForms repro app.

Changes:

  • Adds WAM broker wiring (Windows-only) and an options-bag constructor to ActiveDirectoryAuthenticationProvider, including redirect-URI selection and parent-window forwarding.
  • Adds useWamBroker parsing in SqlAuthenticationProviderManager and serializes tests that mutate the global auth-provider registry.
  • Updates MSAL package versions and introduces a WinForms AzureSqlConnector sample app for manual validation.

Reviewed changes

Copilot reviewed 26 out of 28 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tools/specs/Microsoft.Data.SqlClient.nuspec Bumps MSAL version and adds Microsoft.Identity.Client.Broker package dependency.
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/WamBrokerTests.cs Adds unit tests validating WAM broker enablement/disablement behaviors and parent-window callback clearing.
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/SqlAuthenticationProviderCollection.cs Adds xUnit collection definition to serialize tests that mutate the global provider registry (UnitTests).
src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlAuthenticationProviderCollection.cs Adds xUnit collection definition to serialize tests that mutate the global provider registry (FunctionalTests).
src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj Ensures the new FunctionalTests collection definition is compiled.
src/Microsoft.Data.SqlClient/tests/FunctionalTests/AADAuthenticationTests.cs Serializes AAD functional tests to avoid global provider registry races.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs Parses useWamBroker from config and uses the options ctor when configured.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProviderOptions.cs Introduces the public options-bag type for provider construction.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.Windows.cs Adds Windows-only parent HWND resolution (console/root-owner fallback) for MSAL UI parenting.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs Implements WAM broker enablement, redirect-URI selection, device-code timeout handling, and parent-window forwarding.
src/Microsoft.Data.SqlClient/src/Interop/Windows/User32/User32.cs Adds minimal user32.dll interop for GetAncestor root-owner discovery.
src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Kernel32.cs Adds GetConsoleWindow interop for Windows console HWND discovery.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj Includes new provider/options/interop sources and adds Microsoft.Identity.Client.Broker reference for netfx build.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj Includes new provider/options/interop sources, adds broker reference, and extends IVT.
src/Microsoft.Data.SqlClient.sln Updates solution metadata and adds the AzureSqlConnector app to the solution.
src/Directory.Packages.props Bumps MSAL version and adds centralized version for Microsoft.Identity.Client.Broker.
doc/snippets/Microsoft.Data.SqlClient/ActiveDirectoryAuthenticationProviderOptions.xml Adds XML doc snippets for the new options-bag type.
doc/snippets/Microsoft.Data.SqlClient/ActiveDirectoryAuthenticationProvider.xml Adds XML docs for the new options-based constructor.
doc/apps/Directory.Packages.props Adds central package management for doc/apps projects (SNI package versions).
doc/apps/AzureSqlConnector/README.md Documents the new WinForms repro app (build/run/modes/usage).
doc/apps/AzureSqlConnector/Program.cs App entry point; launches a mode selector and runs the chosen form.
doc/apps/AzureSqlConnector/ModeSelectorForm.cs Startup dialog to choose UI-thread vs worker-thread connection mode.
doc/apps/AzureSqlConnector/MainFormWorker.Designer.cs WinForms designer code for worker-thread connector form.
doc/apps/AzureSqlConnector/MainFormWorker.cs Worker-thread connector variant using Task.Run + sync Open(), with DCF callback UX.
doc/apps/AzureSqlConnector/MainForm.Designer.cs WinForms designer code for UI-thread connector form.
doc/apps/AzureSqlConnector/MainForm.cs UI-thread connector variant supporting OpenAsync vs sync Open() modes.
doc/apps/AzureSqlConnector/IdentityQuery.cs Shared identity-query SQL text used by both connector forms.
doc/apps/AzureSqlConnector/AzureSqlConnector.csproj Adds the WinForms repro app project with conditional TFM selection and project references to SqlClient.
Files not reviewed (2)
  • doc/apps/AzureSqlConnector/MainForm.Designer.cs: Generated file
  • doc/apps/AzureSqlConnector/MainFormWorker.Designer.cs: Generated file

Comment thread doc/apps/AzureSqlConnector/ModeSelectorForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainFormWorker.Designer.cs Outdated
Comment thread doc/apps/AzureSqlConnector/README.md Outdated
Comment thread doc/apps/AzureSqlConnector/README.md Outdated
Comment thread doc/apps/AzureSqlConnector/README.md Outdated
Comment thread doc/apps/AzureSqlConnector/README.md Outdated
Comment thread doc/apps/AzureSqlConnector/MainForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainFormWorker.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainFormWorker.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainFormWorker.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainFormWorker.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainFormWorker.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainFormWorker.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainFormWorker.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Cheena Malhotra <13396919+cheenamalhotra@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 19, 2026 17:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated 8 comments.

Files not reviewed (2)
  • doc/apps/AzureSqlConnector/MainForm.Designer.cs: Generated file
  • doc/apps/AzureSqlConnector/MainFormWorker.Designer.cs: Generated file

Comment thread doc/apps/AzureSqlConnector/MainForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainForm.cs
Comment thread doc/apps/AzureSqlConnector/MainForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainForm.cs Outdated
Comment thread doc/apps/AzureSqlConnector/MainFormWorker.cs
Comment thread doc/apps/AzureSqlConnector/README.md Outdated
Comment thread src/Microsoft.Data.SqlClient.sln
…in netcore project

Co-authored-by: cheenamalhotra <13396919+cheenamalhotra@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Cheena Malhotra <13396919+cheenamalhotra@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 19, 2026 17:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • doc/apps/AzureSqlConnector/MainForm.Designer.cs: Generated file
  • doc/apps/AzureSqlConnector/MainFormWorker.Designer.cs: Generated file

Co-authored-by: cheenamalhotra <13396919+cheenamalhotra@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 19, 2026 18:33
@cheenamalhotra cheenamalhotra removed the request for review from Copilot June 19, 2026 18:33
@cheenamalhotra cheenamalhotra moved this from To triage to In progress in SqlClient Board Jun 19, 2026
@cheenamalhotra cheenamalhotra added the Public API 🆕 Issues/PRs that introduce new APIs to the driver. label Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Public API 🆕 Issues/PRs that introduce new APIs to the driver.

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants