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 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.41%. Comparing base (303aeb9) to head (9de1ec2).

Files with missing lines Patch % Lines
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 0.00% 7 Missing ⚠️
...om/microsoft/sqlserver/jdbc/AuthenticationJNI.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2864      +/-   ##
============================================
- Coverage     56.44%   56.41%   -0.03%     
- Complexity     4559     4562       +3     
============================================
  Files           151      151              
  Lines         34560    34560              
  Branches       5768     5768              
============================================
- Hits          19508    19498      -10     
- Misses        12418    12431      +13     
+ Partials       2634     2631       -3     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants