• No replies
1 Post

Pinned topic access client machine's window's login name from a server using JAVA

‏2012-07-19T07:46:40Z |
how to get the list of client windows login name who are accessing the site in server using JAVA?
I used the following code, but im getting only local machine name . getRemoteUser() is returning null value. I am using tomcat server.
Is there anything to do with windows IIS configuration??
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String clientIP = request.getRemoteAddr();
// Get client's host name
String clintHost = request.getRemoteHost();
String user = request.getRemoteUser();
String computerName = InetAddress.getLocalHost().getHostName();
PrintWriter out = response.getWriter();
out.println("IP : " + clientIP);
out.println("Host: " + clintHost);
out.println("Remote User: "+user);
out.println("Local User: "+ computerName);