David,

You might try the following, instead of getRemoteUser, as we use this to get 
the USERID from IIS.  I inherited this code so I really can't speak to it a lot 
but it's working.

Regards.


' **** get user ID from header ******************

  XUserID = Request.ServerVariables("AUTH_USER")
   
  L=Len(XUserID)
  
  if L > 0 then
     Pos = InStr( XUserID,"\")
     
     if Pos > 0 then
        ID = Right(XUserID,(L-Pos) )
        strUserID = ID
     end if
  else
                strUserID = XUserID
  end if

isUserID = strUserID



-----Original Message-----
From: David kerber [mailto:dcker...@verizon.net] 
Sent: Thursday, July 14, 2011 8:08 AM
To: Tomcat Users List
Subject: Passing user id from web page to tomcat webapp

I have a situation where my users will be logging into their pages on an 
IIS 5 web server, which authenticates them with their user ID and 
password as configured in IIS.  This works fine.

Now I need to add some new functionality to the web site that will be 
using my tomcat webapp, and I don't want them to have to authenticate 
again in my app, so I'm trying to figure out how to pass the user ID 
from the web page on IIS, to my webapp.  I thought 
request.getRemoteUser() would do it, but that's returning null, rather 
than the loggged-in user ID.

Here's what I have so far:

The web page on IIS has a simple form to ask for an input, which is 
needed by the webapp's Servlet (EddSrvConfig):

<form name="frmSiteSelect" action="http://<TC 
server>/EddSrv/EddSrvConfig" method="GET">
     <input type="hidden" name="txtCompany" value="90555">
           <LABEL for="txtSiteID">Site: </LABEL>
               <INPUT type="text" name="txtLocation">
     <INPUT type="submit" name="butGetCharts" value="Get charts">
</form>


When I debug on the TC side, I get the request, and the parameters from 
the <input> controls are there, but I don't get a user ID.  How can I do 
that?  Do I need a different kind of call than a GET?  A different 
method than .getRemoteUser() in my webapp?  Or what?

Thanks!
Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



The information contained in this message and any attachments is intended only 
for the use of the individual or entity to which it is addressed, and may 
contain information that is PRIVILEGED, CONFIDENTIAL, and exempt from 
disclosure under applicable law.  If you are not the intended recipient, you 
are prohibited from copying, distributing, or using the information.  Please 
contact the sender immediately by return e-mail and delete the original message 
from your system.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to