Merged
Conversation
…licationOptions static constructor.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the MSAL client application initialization by replacing undocumented With* methods with a builder-based approach using application options. The key changes include:
- Switching to PublicClientApplicationBuilder.CreateWithApplicationOptions.
- Introducing a conditional addition of WithParentActivityOrWindow for NETFRAMEWORK builds.
- Consolidating the builder configuration and build process.
Comments suppressed due to low confidence (1)
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs:557
- Consider adding unit tests to validate both the branch where _iWin32WindowFunc is set and the branch where it is null to ensure the builder configuration is correct in all cases.
if (_iWin32WindowFunc is not null)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3354 +/- ##
==========================================
+ Coverage 65.16% 67.05% +1.88%
==========================================
Files 300 300
Lines 65379 65376 -3
==========================================
+ Hits 42606 43839 +1233
+ Misses 22773 21537 -1236
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cheenamalhotra
approved these changes
May 17, 2025
mdaigle
approved these changes
May 19, 2025
This was referenced May 19, 2025
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.
This PR is now officially "optional" - see description for details
Description: APIScan was giving us two major errors - usage of undocumented SNI APIs (which we are working on an exception for) and usage of undocumented MSAL APIs. This PR addresses the latter by replacing usages of undocumented
With*methods by providing builder constructor with the application options.When I went back into the automated builds to check to make sure I got all the undocumented MSAL APIs covered, I discovered the errors were no longer in the APIscan results. As it turns out, the APIs have since been documented and are no longer throwing errors. However, in working out a replacement for the formerly-undocumented methods, I worked out a slightly cleaner implementation. So, this change is completely optional from a APIScan perspective, but I think it still has some small value.
Testing: Since this all has to do with AAD, I don't really have the right setup to setup for local testing. Everything still builds, let's see what CI says.