• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get username after login with FORM based authentication

 
K DeLucia
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Servlet API provides the following methods on HttpServletRequest:

 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public String getRemoteUser();

is also helpful.
 
K DeLucia
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. That's just what I need. I'll see if I can get it working!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic