MarkLogic Server 11.0 Product Documentation
xdmp.getRequestUsername

xdmp.getRequestUsername() as String

Summary

If this App Server is using application-level authentication, returns the username in the last successful call to xdmp.login. Otherwise, returns the username from the Authorization header of this App Server request or the current username.

In an isolated evaluation context (see xdmp.isIsolated), this function is not available and throws XDMP-ISOLATED.

Example

xdmp.getRequestUsername();
=> "fred"
Powered by MarkLogic Server | Terms of Use | Privacy Policy