Using SQL Server Integrated Security with Liquibase

From what I have read, we require the the mssql-jdbc_auth dll in order to use a connection string that includes “IntegratedSecurity:true”. My liquibase.properties files has the following connection string:

liquibase.command.url=jdbc:sqlserver://dbLocation;portNumber=1433;databaseName=db_name;encrypt=true;trustServerCertificate=true;integratedSecurity=true;

I have changed nothing about my liquibase installation, everything has worked out of the box. For this issue I have downloaded the mssql-jdbc_auth dll from here: Download - JDBC Driver for SQL Server | Microsoft Learn and extracted the dll to another location and added that location to my account environment variables.

It still does not seem to work. Still getting the following error:

Unexpected error running Liquibase: Connection could not be created to jdbc:sqlserver://dbLocation;portNumber=1433;databaseName=db_name;encrypt=true;trustServerCertificate=true;integratedSecurity=true; with driver com.microsoft.sqlserver.jdbc.SQLServerDriver. This driver is not configured for integrated authentication. ClientConnectionId:6234d58c-8cf6-45af-8991-4e5d50681261

  • Caused by: Unable to load authentication DLL mssql-jdbc_auth-11.2.1.x64

In SSMS I am able to connect to the database using windows authentication

Is there anything I am missing that might help with this, was I supposed to do more than adding the dll to my account’s Path variable?

Problem has been solved after restarting my machine. The Path variable pointing to the auth dll seemed to work accurately after that

I ran into the same issue and managed to get it working by setting the correct path to sqljdbc_auth.dll. I’m running Liquibase from an rdp server, so I had to make sure the DLL was placed in a location included in the system PATH. Also, I had to match the 64-bit version of the DLL with my Java version to avoid connection failures.