0

A few of our database connections are configured to require windows authentication. I am trying to setup a docker container with a java application which should be able to query those databases. However, I keep getting the following error:

Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]

I am not sure if this is even doable - setting up windows auth from within docker container. Has anybody done it?

FYI - I am using docker for Windows

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
VJ4Testing
  • 81
  • 1
  • 9
  • Just a reminder that windows auth only works using the account running the process... and the account running the process in a docker context isn't always what it seems. But this is a different error, so there's still hope. Start with [ensuring all the required java libraries are included in the container.](https://stackoverflow.com/questions/11707056/no-sqljdbc-auth-in-java-library-path) – Joel Coehoorn Nov 01 '22 at 18:43

1 Answers1

0

I believe you need to set up gMSA for this to work. The context is that Windows containers don't get domain-joined. With that, they don't get a computer account to talk to the domain, neither you can use a domain account to authenticate. gMSA solves that, but requires that you configure it with the container host (also referred to as gMSA v1) or K8s (also referred to as gMSA v2). Here's the documentation on how gMSA works: https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/manage-serviceaccounts