0

I am developing a web application using Vaadin 7 in which I need client windows username. What is the best possible way to get client windows username?

I have tried the following code System.getProperty("user.name") but it return server windows user name.

  • 1
    AFAIK Vaadin runs on the server and that's why `System.getProperty` won't work. If you need anything from the client side, you'll have to make the client send it. You could have people log in, and collect their user name that way. – Robert Mar 28 '22 at 15:04
  • Thank you for the suggestion. I would also like to know, using JavaScript is there any other way to get the client username from Chrome browser? – Sadagopan P Mar 29 '22 at 05:38
  • Late to the party, but if I understood correctly what you were trying to do, browser security features prevent querying this information. See e.g. https://stackoverflow.com/questions/9518092/how-to-get-the-name-of-the-current-windows-user-in-javascript – Anna Koskinen May 20 '22 at 13:33

0 Answers0