I am building an webapp in JSF-2. I want to know the username of person who is viewing the website.
Client
<h:outputText value="Welcome #{mailRoomAppView.userID}" style="float: right; float: top" />
Backend Bean
public void setUserID(){ userID = System.getProperty("user.name"); }
App is showing Hello mwadmin which is from the system where war is deployed.
I want to get the windows userid of the request session
I tried below code but it returns null FacesContext.getCurrentInstance().getExternalContext().getRemoteUser()