is there a way to get the logged in user name (and group) from a Tomcat system. I read something about configuring Tomcat, so it is getting the user information out of a dat
You can try these two methods from the HttpServletRequest interface.
getUserPrincipal()
returns a Principal from which you can get the logged used as getUserPrincipal().getName()
.
isUserInRole("Administrators")
returns true if the current Principal is in the provided role.
Of course this only works if you are using tomcat realm authentication found here.
getUserPrincipal().getName()
There's a typo in above answer.