if you use JAAS to login to your application, you are able to get the active user(name) the following way:
final Principal principal = FacesContext.getCurrentInstance()
.getExternalContext().getUserPrincipal();
if (null == principal) {
return null;
}
return principal.getName();