PrincipalUtils

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

Methods

getUser

Description:

MethodReturn valuesDescription

getUser()

String

Get the userId of the the logged user.

The user must be logged before executing the methods.

Example:

package com.openkm;

package com.openkm.test;

import com.openkm.spring.PrincipalUtils;

public class Test {
	public static void main(String[] args) throws Exception {
		System.out.println(PrincipalUtils.getUser());
	}
}