Solved

Retrieving authenticated user name - Tomcat 4.1.30 with IIS 5.0 using Windows Integrated Authentication

Posted on 2004-09-29
7
769 Views
Last Modified: 2007-12-19
Environment:
IIS 5.0
Tomcat 4.1.30
JK2 - isapi redirector connecting IIS to Tomcat
Windows 2000 Active Directory

Setup:
IIS is setup with virtual directories to access the examples JSP and servlets. The virtual directory is setup to have WINDOWS INTEGRATED AUTHENTICATION.
The user requests go to the IIS server, IIS server authenticates the user against the Active Directory and routes the request to tomcat using the JK2 isapi dll.

What is working, is that I am able to access and run the example JSPs and servlets going through  IIS without any problems.  I have also tested out the authentication from different domains and it is working correctly.  

The problem:  I need to get a handle to the "user" that logged in (the user who went through authentication and is accessing the application). I have printed out all the header elements in the request and do not see an entry of the logged in user.   I have tried setting "request.tomcatAuthentication=false" in the jk2.properties files and that did not make any difference.

Question: How do I get the authenticated user from the request in Tomcat?  Are there some specific defn. I need to set in jk2.properties file to make the logged in user id visible in Tomcat?  Any help would be much appreciated.


My jk2.properties file is given below

# socket config
channelSocket.port=8009
channelSocket.address=127.0.0.1
channelSocket.maxPort=port+10
# IIS will do the WINDOWS INTEGRATED AUTHENTICATION
request.tomcatAuthentication=false

-SP
0
Comment
Question by:spanaval
  • 2
  • 2
7 Comments
 
LVL 14

Accepted Solution

by:
alimu earned 250 total points
ID: 12185959
If you are using ASP it's: Request.ServerVariables("LOGON_USER")

The only thing I could find on this http://lists.evolt.org/archive/Week-of-Mon-20040209/155375.html where someone is having a similar issue.  They were referred to the samba site: http://jcifs.samba.org/src/docs/ntlmhttpauth.html

it may be a good idea to post a minimal point question containing a url link to this one in the "Web Servers" forum - you might pickup more people with tomcat/jk2 experience and someone may have done this before.
0
 
LVL 37

Assisted Solution

by:meverest
meverest earned 250 total points
ID: 12187649
String userName = request.getRemoteUser();
0
 
LVL 14

Expert Comment

by:alimu
ID: 12551051
Hi spanaval,
Can you please provide some feedback to advise whether this resolved your problem or not?

If this is fixed up or you've found your own answer could you close off your question please?
If you're not sure how, here's the options: http://www.experts-exchange.com/help.jsp#hs5
Thanks!
AJ
0
 
LVL 37

Expert Comment

by:meverest
ID: 13359222
suggest split alimu, meverest.
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now