Skip to content
Other versions

Loading…

PrincipalUtils

Utility methods for retrieving information from the security context. For example, get the actual user ID from the security context session or get the actual tenant of the logged-in user.

Description:

Method Return values Description
getUser() String Get the user ID of the logged-in user.

Example:

package com.openkm;
import com.openkm.principal.PrincipalUtils;
public class Test {
public static void main(String[] args) {
try {
System.out.println(PrincipalUtils.getUser());
} catch (Exception e) {
e.printStackTrace();
}
}
}