Get OS Client username

Hi I`m new to Vaadin and webbased application development and strugling to get the OS client username in my web based Vaadin application.

in Java application following line will return the OS client currently logged in username but in web that returns offcourse the username of the logged in user on the server.

sSystemUserName = System.getProperty(""); I want to retrieve the OS username of the currently logged in user is that possible??

In one example I found following code but “request” (end line 3) is not defined/declared in the example (Class Vaadin.User???)

import com.vaadin.server.VaadinServletRequest;

VaadinServletRequest vsRequest = (VaadinServletRequest)request;
HttpServletRequest hsRequest = vsRequest.getHttpServletRequest();
String un = hsRequest.getParameter(“username”);
[/code]Following code did not retrieve the username on line 8 or 9.

import javax.servlet.http.HttpServletRequest;

public static String getClientUserName()
String sUserName = “”;
sUserName = servletRequest.getRemoteUser();
sUserName = servletRequest.getUserPrincipal().toString();

catch (Exception ex){System.out.println(“Could not retrieve username: Exeption:” + ex);}
return sUserName;
[/code]I seem to miss some basic knowledge here.
Can someone please provide/direct me with an example on how to proceed with this.

Windows 7 clients
Android devices
Vaadin Version 7.1.14

Thank you in advance.

The short answer is, you can’t. Modern browsers do not allow you to access this for security reasons.

Both getRemoteUser() and getUserPrincipal() are related to authentication of the session towards the server, not the OS user.

Some older browsers/OSes allowed the web page to access the current user name - see e.g.
this page