You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Aris Javier <ar...@eazix.com> on 2004/09/02 09:56:28 UTC

SOLVED! RE: Why request.getRemoteUser() returns NULL ?

I found it!

Thanks to Akash Kava.. 

to get User: request.getHeader("IIS-REMOTE-USER");
to get Host: request.getHeader("IIS-REMOTE-ADDR");

if you're using Tomcat+IIS thru jspisapi filter.. 
it make use of NTLM authentication...

no need for jcifs filter.. no need to change server.xml or web.xml or
jk2.properties...

Thanks Akash!!!

Also watch out for JWEBEX (JWX)... it will replace JSP...
It has features of .NET!
Fast coding, auto login, auto integration with IIS, it will replace jsp,

it can be used with existing tomcat without any new changes

yes! go JAVA!



-----Original Message-----
From: Allistair Crossley [mailto:Allistair.Crossley@QAS.com] 
Sent: Wednesday, September 01, 2004 7:14 PM
To: Tomcat Users List
Subject: RE: Why request.getRemoteUser() returns NULL ?


Hi,

Ah! tomcatAuthentication=false is configured in JK2 which is what I am
using - JK2 ISAPI filter for IIS ...

http://jakarta.apache.org/tomcat/connectors-doc/jk2/jk2/installhowto.htm
l

Perhaps this is a problem with your Jspisapi filter. Try changing to
JK2.

You do not need JCIFS since IIS will automatically put the Windows
authenticated user into the request. 

ADC.

> -----Original Message-----
> From: Aris Javier [mailto:aristotle.javier@eazix.com]
> Sent: 01 September 2004 11:47
> To: Tomcat Users List
> Subject: RE: Why request.getRemoteUser() returns NULL ?
> 
> 
> im using tomcat5.0.25 and IIS via Jspisapi filter...
> 
> are you using jcifs in your authentication to get
> request.getRemoteUser() to work?
> 
> i tried removing tomcatAuthentication="false" in server.xml but to no 
> avail. it still fails. =|
> 
> by changing the jk2.properties file, i don't need to include jcifs 
> filter in web.xml?
> 
> -----Original Message-----
> From: Allistair Crossley [mailto:Allistair.Crossley@QAS.com]
> Sent: Wednesday, September 01, 2004 6:24 PM
> To: Tomcat Users List
> Subject: RE: Why request.getRemoteUser() returns NULL ?
> 
> 
> remove the tomcatAuthentication="false" attributes from server.xml and

> use only jk2.properties? we do not have tomcatAuthentication="false" 
> in the server.xml and it works that way. are you connecting via a
> webserver? are you using AJP?
> 
> ADC
> 
> > -----Original Message-----
> > From: Aris Javier [mailto:aristotle.javier@eazix.com]
> > Sent: 01 September 2004 10:26
> > To: Tomcat Users List
> > Subject: RE: Why request.getRemoteUser() returns NULL ?
> > 
> > 
> > i removed the comment, but still request.getRemoteUser()
> returns NULL.
> 
> > =|
> > 
> > here's my server.xml;
> > <Server port="8005" shutdown="SHUTDOWN" debug="0">
> >   <Listener
> > className="org.apache.catalina.mbeans.ServerLifecycleListener"
> >             debug="0"/>
> >   <Listener 
> > className="org.apache.catalina.mbeans.GlobalResourcesLifecycle
> > Listener"
> >             debug="0"/>
> > 
> >   <!-- Global JNDI resources -->
> >   <GlobalNamingResources>
> > 
> >     <!-- Test entry for demonstration purposes -->
> >     <Environment name="simpleValue" type="java.lang.Integer"
> > value="30"/>
> > 
> >     <!-- Editable user database that can also be used by
> >          UserDatabaseRealm to authenticate users -->
> >     <Resource name="UserDatabase" auth="Container"
> >               type="org.apache.catalina.UserDatabase"
> >        description="User database that can be updated and saved">
> >     </Resource>
> >     <ResourceParams name="UserDatabase">
> >       <parameter>
> >         <name>factory</name>
> >  
> > <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
> >       </parameter>
> >       <parameter>
> >         <name>pathname</name>
> >         <value>conf/tomcat-users.xml</value>
> >       </parameter>
> >     </ResourceParams>
> > 
> >   </GlobalNamingResources>
> >   <Service name="Catalina">
> >   <Connector port="8080" maxThreads="150" minSpareThreads="25"
> > maxSpareThreads="75"
> >                enableLookups="false" redirectPort="8443" 
> > acceptCount="100"
> >                debug="0" connectionTimeout="20000" 
> >                disableUploadTimeout="true"
> > tomcatAuthentication="false"
> > />
> > 
> >   <Connector port="8009"
> >                enableLookups="false" redirectPort="8443" debug="0"
> >                protocol="AJP/1.3" tomcatAuthentication="false" />
> >     <Engine name="Catalina" defaultHost="localhost" debug="0">
> > 
> >       <Logger className="org.apache.catalina.logger.FileLogger"
> >               prefix="catalina_log." suffix=".txt"
> >               timestamp="true"/>
> >       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >                  debug="0" resourceName="UserDatabase"/>
> > 
> >       <Host name="localhost" debug="0" appBase="webapps"
> >        unpackWARs="true" autoDeploy="true"
> >        xmlValidation="false" xmlNamespaceAware="false">
> > 
> >         <Logger className="org.apache.catalina.logger.FileLogger"
> >                  directory="logs"  prefix="localhost_log." 
> > suffix=".txt"
> >             timestamp="true"/>
> >             
> >         <Context path="/eqms" docBase="eqms" debug="5" 
> > reloadable="true" crossContext="true">
> >               <Logger 
> > className="org.apache.catalina.logger.FileLogger"
> >                    prefix="localhost_eqms_log." suffix=".txt"
> >                    timestamp="true"/>
> > 
> >               <Resource name="jdbc/EQMS_DS"
> >                    auth="Container"
> >                    type="javax.sql.DataSource"/>
> > 
> >               <ResourceParams name="jdbc/EQMS_DS">
> >                   <parameter>
> >                       <name>factory</name>
> >  
> > <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> >                   </parameter>
> > 
> >                   <!-- Maximum number of dB connections in
> pool. Make
> > sure you
> >                      configure your mysqld max_connections large 
> > enough to handle
> >                      all of your db connections. Set to 0 for 
> > no limit.
> >                      -->
> >                   <parameter>
> >                       <name>maxActive</name>
> >                       <value>100</value>
> >                   </parameter>
> > 
> >                   <!-- Maximum number of idle dB
> connections to retain
> 
> > in pool.
> >                      Set to 0 for no limit.
> >                      -->
> >                   <parameter>
> >                       <name>maxIdle</name>
> >                       <value>30</value>
> >                   </parameter>
> > 
> >                   <!-- Maximum time to wait for a dB connection to
> > become available
> >                      in ms, in this example 10 seconds. An
> > Exception is
> > thrown if
> >                      this timeout is exceeded.  Set to -1 to wait
> > indefinitely.
> >                      -->
> >                   <parameter>
> >                       <name>maxWait</name>
> >                       <value>10000</value>
> >                   </parameter>
> > 
> >                   <!-- MySQL dB username and password for dB 
> > connections
> >                   <parameter>
> >                       <name>username</name>
> >                       <value>javauser</value>
> >                   </parameter>
> >                       <parameter>
> >                       <name>password</name>
> >                       <value>javadude</value>
> >                   </parameter>
> >                   -->
> >                   <!-- Class name for ACCESS JDBC driver -->
> >                   <parameter>
> >                        <name>driverClassName</name>
> >                        <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
> >                   </parameter>
> > 
> >                   <!-- The JDBC connection url for
> connecting to your
> > MySQL dB.
> >                      The autoReconnect=true argument to the
> url makes
> > sure that the
> >                      mm.mysql JDBC Driver will
> automatically reconnect
> 
> > if mysqld closed the
> >                      connection.  mysqld by default closes idle
> > connections after 8 hours.
> >                      -->
> >                   <parameter>
> >                       <name>url</name>
> >                       <value>jdbc:odbc:EQMS_DS</value>
> >                    </parameter>
> >               </ResourceParams>
> >         </Context>
> >  
> >       </Host>
> > 
> >     </Engine>
> > 
> >   </Service>
> > 
> > </Server>
> > 
> > 
> > -----Original Message-----
> > From: Allistair Crossley [mailto:Allistair.Crossley@QAS.com]
> > Sent: Wednesday, September 01, 2004 5:09 PM
> > To: Tomcat Users List
> > Subject: RE: Why request.getRemoteUser() returns NULL ?
> > 
> > 
> > you have
> > 
> > # request.tomcatAuthentication=false
> > 
> > which means that line is commented out and not used. Change it to
> > 
> > request.tomcatAuthentication=false
> > 
> > ADC
> > 
> > > -----Original Message-----
> > > From: Aris Javier [mailto:aristotle.javier@eazix.com]
> > > Sent: 01 September 2004 10:00
> > > To: Tomcat Users List
> > > Subject: RE: Why request.getRemoteUser() returns NULL ?
> > > 
> > > 
> > > i added request.tomcatAuthentication=false inside
> jk2.properties...
> > > and set
> > > windows integrated authentication on my website.
> > > 
> > > but still... request.getRemoteUser() returns NULL... =|
> > > 
> > > here's my jk2.properties file;
> > > 
> > > ## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT
> > IS STOPED
> > > ## WHEN YOU EDIT THE FILE.
> > > 
> > > ## COMMENTS WILL BE _LOST_
> > > 
> > > ## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.
> > > 
> > > # Set the desired handler list
> > > # handler.list=apr,request,channelJni
> > > #
> > > # Override the default port for the socketChannel
> > > # channelSocket.port=8019
> > > # Default:
> > > # channelUnix.file=${jkHome}/work/jk2.socket
> > > # Just to check if the the config  is working
> > > # shm.file=${jkHome}/work/jk2.shm
> > > 
> > > # In order to enable jni use any channelJni directive
> > > # channelJni.disabled = 0
> > > # And one of the following directives:
> > > 
> > > # apr.jniModeSo=/opt/apache2/modules/mod_jk2.so
> > > 
> > > # If set to inprocess the mod_jk2 will Register natives
> > itself # This
> > > will enable the starting of the Tomcat from mod_jk2 # 
> > > apr.jniModeSo=inprocess
> > > 
> > > # request.tomcatAuthentication=false
> > > 
> > > -----Original Message-----
> > > From: Allistair Crossley [mailto:Allistair.Crossley@QAS.com]
> > > Sent: Wednesday, September 01, 2004 4:21 PM
> > > To: Tomcat Users List
> > > Subject: RE: Why request.getRemoteUser() returns NULL ?
> > > 
> > > 
> > > we do it by adding
> > > 
> > > request.tomcatAuthentication=false
> > > 
> > > into tomcat/conf/jk2.properties
> > > 
> > > if you are using IIS then you also need to set Windows Integrated 
> > > Authentication on your default website.
> > > 
> > > ADC
> > > 
> > > > -----Original Message-----
> > > > From: Aris Javier [mailto:aristotle.javier@eazix.com]
> > > > Sent: 01 September 2004 08:04
> > > > To: tomcat-user@jakarta.apache.org
> > > > Subject: Why request.getRemoteUser() returns NULL ?
> > > > 
> > > > 
> > > > i found this in jguru...
> > > >  
> > > > <Connector port="8009" protocol="AJP/1.3"
> > > > protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"
> > > > redirectPort=" 8443" tomcatAuthentication="false">
> > > >  
> > > > it stated there that if i do this in server.xml,
> > > > request.getRemoteUser()
> > > > will not equal to NULL.. ?
> > > >  
> > > > i did, but request.getRemoteUser() returns NULL
> > > >  
> > > > please, anybody.. do you know how to get
> > request.getRemoteUser() to
> > > > work?
> > > >  
> > > > i need it badly! please!
> > > >  
> > > > aris
> > > >  
> > > >  
> > > > 
> > > 
> > > 
> > > <FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE>
> > > -------------------------------------------------------
> > > QAS Ltd.
> > > Developers of QuickAddress Software
> > > <a href="http://www.qas.com">www.qas.com</a>
> > > Registered in England: No 2582055
> > > Registered in Australia: No 082 851 474
> > > -------------------------------------------------------
> > > </FONT>
> > > 
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> > > 
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> > > 
> > > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org