How can I programmatically know, in my web app, the username and password or user role of the user who is currently logged into tomcat on which the app is deployed?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This information is available by
HttpServletRequestand inherently thus alsoExternalContext.The following methods are available:
You cannot get the password in any way for security reasons.
Note that the
HttpServletRequestis available as#{request}in EL. So the following should also be possible: