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?
Comments
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)?
We use the Gateway to make Queries and Stored Procedure calls from our Business Processes/Business Operations.
According to Microsoft, I had to download the 12.8 driver. But that did not work either, Microsoft is saying I need to install Maven and POM.
I published an article based on my findings...
Connecting using JDBC to MS Azure SQL through Microsoft Entra and Active
I am still working with WRC and Microsoft to determine where the issue is.