File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes How to retrieve the user id from the web browser Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "How to retrieve the user id from the web browser" Watch "How to retrieve the user id from the web browser" New topic
Author

How to retrieve the user id from the web browser

Brian Pembroke
Greenhorn

Joined: Jan 21, 2003
Posts: 6
I need to be able to retrieve the user id of the user logged in from the web browser. I do not want to prompt the user for a login id and password. The is for an internal application. All the users will be using IE and Windows. I need to be able to retrieve the id from a Java Servlet.

This is a very easy thing to do in IIS.
HttpContext.Current.User.Identity.Name.ToString()

Any ideas would be greately appreciated.

Thanks,
Brian
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12324
    
    1
How are you handling user log-in?

I suggest you look at the methods in the API for HttpServletRequest - for example:

String getRemoteUser();

Bill


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to retrieve the user id from the web browser
 
Similar Threads
Stopping a backend process if user closes the browser window
confirmation identity via email
Struts 2 create and set values of model object
How to download a file from a database using jsp
EJB and JMS - creating a unique message ID