0

Is there a way to extract the username logged into the network from a Java web-based application?

  • 2
    That answer depends much on the architecture of your application. We need much more information. – Tripp Kinetics Aug 07 '15 at 15:30
  • With a windows application, we can extract the username logged into the network from HttpContext.Curret.Request.ServerVariables["LOGON_USER"]. Is there a way to do the same from a java web-based application? – lilylove2shop Aug 07 '15 at 16:24
  • 2
    What do you mean? Are you simply trying to get the user logged in to the computer or are you running a Tomcat server and wish to know the user it is running as or something else? I think we need some more information to be able to answer. – carpenter Aug 07 '15 at 16:43
  • I want to get the user logged in to the computer – lilylove2shop Aug 07 '15 at 18:04

1 Answers1

1

This should do the trick.

System.getProperty("user.name");
carpenter
  • 1,192
  • 1
  • 14
  • 25