I am using FORM-based (JDBC Realm) container-managed authentication in my Tomcat webapp. My webapp consists of JSPs, servlets, and is Java/MySQL based webapp for Tomcat. I am using Tomcat v. 5.0....
For authenticating users logging-in to the website, I am using Tomcat's built-in FORM-based authentication. Thus, I have a Login.html form, where users enter their username and password. In the form source code, the username is recorded as param name "j_username", and pass as "j_password"--as required for Tomcat authentication. The action attribute of the form is "j_securitycheck"--this is the resource that receives the form data on submit, and which authenticates the user.
Here is my problem: I need to capture the j_username and j_password parameters, and store them for later use, after authentication. But it looks like both of the parameters are deleted by Tomcat upon successful authentication. Those 2 parameters disappear once Tomcat authenticates them. But I need them later on in the webapp, so I need to capture them. How can I do this? Please only reply if you have an idea which you have already tested. Please no brainstorming--only tried and tested solutions.
I have already tried:
a filter before j_securitycheck, but there is no way to map the filter to j_securitycheck--this failed.
a JSP between Login.html and j_securitycheck to read those 2 parameters, and attach them to the session object as session attributes: but this doesn't work, either.
Hi Brad Sisk, i am also doing the SSL for my application using tomcat. i came to know that you have developed that security. please can you send the sample security program what you have done ?. i have some hectic and importent work on this and more over i am new to this security.