The Artima Developer Community
Sponsored Link

Java Answers Forum
How to Capture j_username and j_password in Tomcat FORM authentication

1 reply on 1 page. Most recent reply: Dec 22, 2008 4:55 AM by guru raj

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Brad Sisk

Posts: 1
Nickname: rotvang
Registered: Feb, 2007

How to Capture j_username and j_password in Tomcat FORM authentication Posted: Feb 16, 2007 11:31 AM
Reply to this message Reply
Advertisement
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.


guru raj

Posts: 1
Nickname: gururaj321
Registered: Dec, 2008

Re: How to Capture j_username and j_password in Tomcat FORM authentication Posted: Dec 22, 2008 4:55 AM
Reply to this message Reply
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.

waiting for your reply....


regards
Guru

Flat View: This topic has 1 reply on 1 page
Topic: Need Java Help! Previous Topic   Next Topic Topic: JRuby Co-Developer to conduct Workshop on JRuby, Testing Java with Ruby

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use