Skip to content

Conversation

@Ananya2
Copy link
Contributor

@Ananya2 Ananya2 commented Dec 17, 2025

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

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.98%. Comparing base (303aeb9) to head (c9071e7).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2864      +/-   ##
============================================
+ Coverage     56.44%   58.98%   +2.53%     
- Complexity     4559     4743     +184     
============================================
  Files           151      151              
  Lines         34560    34575      +15     
  Branches       5768     5776       +8     
============================================
+ Hits          19508    20394     +886     
+ Misses        12418    11409    -1009     
- Partials       2634     2772     +138     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Ananya2 Ananya2 added this to the 13.3.2 milestone Feb 2, 2026
@github-project-automation github-project-automation bot moved this to In progress in MSSQL JDBC Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

1 participant