You can try these two methods from the HttpServletRequest interface.
getUserPrincipal() returns the Principal from which you can get the registration used as getUserPrincipal().getName() .
isUserInRole("Administrators") returns true if the current Principal is in the provided role.
Of course, this only works if you use the tomcat domain authentication found here .
rmarimon
source share