This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes How to get username after login with FORM based authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to get username after login with FORM based authentication" Watch "How to get username after login with FORM based authentication" New topic
Author

How to get username after login with FORM based authentication

K DeLucia
Ranch Hand

Joined: Apr 11, 2008
Posts: 68
I have an application that uses Tomcat FORM based authentication. I'm able to login successfully, but I don't know how to get the username. I'm having users log in with their email address and on the page they are redirected to (request.jsp), I want to capture the email address they entered so I can display it, and use it in the servlet that runs when that request.jsp form is submitted.

Any pointers on how to achieve this would be appreciated. Thanks!
Javid Jamae
Author
Ranch Hand

Joined: May 14, 2008
Posts: 198
The Servlet API provides the following methods on HttpServletRequest:



Author: JBoss in Action, javidjamae.com, @javidjamae on Twitter
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41180
    
  45
public String getRemoteUser();

is also helpful.


Ping & DNS - my free Android networking tools app
K DeLucia
Ranch Hand

Joined: Apr 11, 2008
Posts: 68
Thanks. That's just what I need. I'll see if I can get it working!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get username after login with FORM based authentication
 
Similar Threads
Pass username and password via browser in Formbased Authentication
Tomcat5, Forms based authentication and poor man's Single SignOn
FORM and BASIC authentication in the same web app
form action default request type
java custom login, strategy