title: XPages getEffectiveUserName()
body: <p>I'm using an <a href="http://www.wissel.net/blog/d6plinks/shwl-7mgfbn" rel="nofollow">XPage as an agent (XAgent)</a> which makes an SSJS call into some Java classes stored as Java design elements. I want the processes which are instigated by the XPage to be in the context of the user I'm currently signed into the browser as. However everything seems to be running as me, I guess based on the last signature on the XPage?</p>
  
  <p>For example, in my custom classes the following returns my name when I need it to be returning the user's name:</p>
  
  <pre><code>DominoUtils.getCurrentSession().getEffectiveUserName()
  </code></pre>
  
  <p>When using old school Domino agents, the effective username is determined by the "Run as Web User" or "Run on behalf of" fields in the agent properties.</p>
  
  <p>Is it possible to achieve the same functionality when using an XPage?</p>