How to receive the current user name in Active Directory in xPages?

How to receive the current user name in Active Directory in xPages?

I tried to use java.lang.System.getProperty(“user.name”) in javascript. But it seems that for security reasons I can’t receive it.

java.lang.System.getProperty(“os.name”) works fine.

I tried local java agent with System.out.println( System.getProperty(“user.name”) ) it works.

What would be the reason?

Is there a valid method to receive AD current user name?

Subject: The reason is found

Additionpermission java.util.PropertyPermission “user.name”, “read”;

to

C:\Program Files\Java\jre6\lib\security\java.policy

has fixed the issue.