Search code examples
javawinapisingle-sign-onkerberosjna

Secur32Util.getUserNameEx replacement


I have a case where a Java application uses Secur32Util.getUserNameEx from jna to obtain the username in a format for a single-sign-on. There are some machines where this function call is executing for a few minutes. I was not able to figure out why that is yet. But in the meantime, I would like to ask if there is a replacement that can be used to substitute that call.

To start the discussion, I have already tested that NTSystem#getName() and NTSystem#getDomain() return immediately on the machine that is stuck on executing Secur32Util.getUserNameEx. Are those functions interchangeable?


Solution

  • I have created a corresponding C++ application that executed without delay. But, it turned out that my application was using JNA version 3.3 and when I updated to the current version it does not have that problem.