title: How to obtain logged in user name in JSF when using container managed authentication
body: <p>I have configured a form based log in in my JSF 2.0 Application on GlassFish 3 server, using a custom Realm. What is the simpliest way of getting information about a logged in user, i.e. the users name.</p>
  
  <p>Is this possible? Or is the current session just associated with a security role? If so, is there some way of making this possible without changing the log in configuration?</p>
  
  <p>Simply put, what I want is to display a simple message like: </p>
  
  <blockquote>
    <p>Logged in as username</p>
  </blockquote>
  
  <p>on my webpages.</p>