Remove ADAL dependency: Migrate Windows AAD Integrated Auth to MSQA APIs via mssql-auth.dll. #2864
+17
−19
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.
Summary
This PR removes the last remaining ADAL dependency in the JDBC driver by migrating Windows Active Directory Integrated Authentication from the deprecated ADAL library to MSQA (Microsoft SQL Query Authentication) APIs. The authentication flow now uses mssql-auth.dll instead of the legacy adalsql.dll (ADAL-based).
Problem Statement
Windows AAD Integrated authentication relies on native calls through mssql-jdbc_auth.dll, which called the deprecated adalsql.dll (ADAL). This was the last remaining ADAL dependency in the JDBC driver and needed to be removed as part of Microsoft's ADAL deprecation initiative.
Solution
This change modernizes Windows AAD Integrated Authentication by refactoring the native auth flow to route all token acquisition through MSQA APIs via mssql-auth.dll, replacing legacy ADAL usage with MSAL C++ and fully removing the adalsql.dll dependency. The JNI interface has been updated to align with the new MSQA-based native contract, eliminating ADAL-specific parameters and references, and updating error messages to reflect the new DLL architecture.
Old Flow:
SQLServerConnection.java → mssql-jdbc-auth.dll (JNI wrapper) → adalsql.dll (deprecated ADAL) → Azure Active Directory
New Flow:
SQLServerConnection.java → mssql-jdbc-auth.dll (JNI wrapper) → mssql-auth.dll (MSAL C++) → Azure Active Directory