Hi Manoj,
I am also looking for JNA solution to authenticate the windows NT credientials. When I execute the following program, I am getting unsatisfiedLinkerror. I have added the jna.jar file in the windows CLASSPATH. Have you got a solution for your problem, if please provide me the code. I am using Apache tomcat and windows XP server.
import com.sun.jna.Library;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.Native;
import com.sun.jna.Platform;
public class HelloWorld {
public interface CLibrary extends StdCallLibrary {
CLibrary INSTANCE = (CLibrary)
Native.loadLibrary((Platform.isWindows() ? "advapi32" : "c"), CLibrary.class);
public boolean LogonUser(String userName, String domain,String password, int dwLogonType, int dwLogonProvider, IntByReference lToken);
}
public static void main(String[] args) {
IntByReference lToken=null;
CLibrary.INSTANCE.LogonUser("username","domainName","bangalore",0,0,lToken);
}
}
Thanks