I want to develop an Java application that can detect the user logged on a Windows Domain. These credentials are going to be used to logging on the Java application running on Tomcat.
How can I do this? I want to know the remote user accessing my web app. This user is logged on in Active Directory.
This is my solution:
Put jcifs-1.2.7.jar on [TOMCAT_HOME]/common/lib directory.
Modify application’s web.xml adding the followin text to section webapp:
And the you can get the remote user using request.getRemoteUser() whithout prompt.
See you.