Current Logged in User and Roles in ADF and Fusion Apps
A) Using the groovy Expression.
adf.context.securityContext.getUserPrincipal().getName()
adf.context.securityContext.getUserName()
For Roles use
For Roles use
adf.context.securityContext.getUserRoles()
B) Java Code
You can get User Name in Java code also using the following code. ADFContext adfCtx = ADFContext.getCurrent();
SecurityContext secCntx = adfCtx.getSecurityContext();
String user = secCntx.getUserPrincipal().getName();
String userName = secCntx.getUserName();
String[] Roles = secCntx.getUserRoles();
C) Expression Language
You can bind ADF Faces componenets with the following EL to get logged User Name. #{securityContext.userName}
#{securityContext.userRoles}
D) In Fusion Applications (On Premise Implementation) ApplSession session = ApplSessionUtil.getSession();
String guid1 = session.getUserGuid();
Comments