[6.1] WAM Broker changes#4387
Draft
cheenamalhotra wants to merge 6 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
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
useWamBrokerparsing inSqlAuthenticationProviderManagerand serializes tests that mutate the global auth-provider registry. - Updates MSAL package versions and introduces a WinForms
AzureSqlConnectorsample 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
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
cheenamalhotra
commented
Jun 19, 2026
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>
Contributor
There was a problem hiding this comment.
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
…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>
Contributor
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports changes from #4288 to release/6.1 branch.