To get the username of the logged-in user, you could call (On a RenderRequest or ActionRequest):
String username = request.getRemoteUser()
To get the principal
java.security.Principal principal = request.getUserPrincipal()
If the user is not authenticated, both methods would return null.
Comments