I am doing a Java EE web application that requires Single Sign On with Active Directory.
The application will no longer prompt for a username and password. The authentication process would require retrieval of the current Windows logged on user. Once I have the user, I need to query Active Directory to get the roles for that logged on user. I am aware that this will exclude non-Windows users, but this is an internal application and all clients are using Windows.
I have to implement the SSO in 2 Java EE web applications. 1 application is runnning on GlassFish v2.1.1 (JDK 1.6) and the other is running on Tomcat (JDK 1.5).
Basically my main problem is how to retrieve the current Windows logged on user.
I've already come across JAAS and Kerberos. Kindly correct me if I'm wrong. My understanding is that these are authentication protocol and they do not have the feature to retrieve the current windows logged on user.
I've already tried the following but I am always getting null
or Server's own username.
System.getProperty("user.name");
new com.sun.security.auth.module.NTSystem().getName();
request.getUserPrincipal().getName();
System.getenv("USERNAME");
I am open to any suggestions.