getUser (XSPContext - JavaScript)

Gets the current user from the directory.

Defined in

XSPContext (JavaScript)

Defined in

XSPContext (JavaScript)

Syntax

getUser() : DirectoryUser
Return value Description
DirectoryUser The user entry in the directory.

Usage

The user may be anonymous if authentication has not occurred.

Examples

This example gets distinguished name of the current user.
function p(stuff) {
	print("<<<" + stuff + ">>>");
}

user : DirectoryUser;

try {
	user = context.getUser();
	p("Current user = " + user.getDistinguishedName());

} catch(e) {
	p("Error = " + e);
}