I want to develop an Java application that can detect the user logged on a Window Domain. These credentials are going to be used to logging on the Java application.
How can I do this?
Thanks!
System.getProperty("user.name")
If you need to domain name, you can use this :
com.sun.security.auth.module.NTSystem NTSystem = new
com.sun.security.auth.module.NTSystem();
System.out.println(NTSystem.getName());
System.out.println(NTSystem.getDomain());
Bye.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With