Question
· Jan 8

JDBC - Microsoft Entra Authentication

We connect to MS SQL Databases using the Microsoft JDBC Driver 12.2 using the following URL

jdbc:sqlserver://<server>:<port>;database=<database name>;trustServerCertificate=true;integratedSecurity=true;authenticationScheme=NTLM;domain=osumc;authentication=NotSpecified

They want to migrate the databases to the Azure Cloud and in doing so we need the Authentication to change to go through Microsoft Entra. I was given the following URL

jdbc:sqlserver://<server>:<port>;user=<user>;password=<password>;encrypt=true;trustServerCertificate=true;hostNameInCertificate=<certificate>;loginTimeout=30;Authentication=ActiveDirectoryPassword;

but now I can not connect and get the following errror..

Connection failed.
Remote JDBC error: com.microsoft.sqlserver.jdbc.SQLServerException: Failed to load MSAL4J Java library for performing ActiveDirectoryPassword authentication..

From reading about MSAL4J it is another .jar file that I guess I need to install and include in the class path.

Has anyone else ever ran into this issue?

Product version: IRIS 2024.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1 (Build 267_2U) Tue Apr 30 2024 16:06:39 EDT [HealthConnect:7.2.0-1.r1]
Discussion (4)2
Log in or sign up to continue

I haven’t had a chance to test it myself yet—the sheer scope of this site has been a bit overwhelming for me so far: Connect using Microsoft Entra authentication - JDBC Driver for SQL Server | Microsoft Learn.

It does seem like your guess might be correct—you could still be missing a dependency. As noted on this page, the required dependencies can vary depending on the specific parameters you're working with. Wishing you good luck with it! 😊

By the way, are you trying to connect using a query tool or via IRIS (gateway)?