You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark Leone <mi...@verizon.net> on 2008/03/19 23:46:19 UTC

Manager app authentication not working with JDBCRealm

I can't get the manager app working with authentication using JDBCRealm, 
even though I've configured it identically to an app I developed that 
uses the same JDBCRealm instance successfully. In both cases, the app 
requires a user with role "manager", and the same authentication setup 
works for my app but not for manager.

I have the following in the file 
%catalina_home%\webapps\manager\WEB-INF\web.xml (and also in the web.xml 
for my custom app)

<security-constraint>
- <#> <web-resource-collection>
  <web-resource-name>HTMLManger and Manager command</web-resource-name>
  <url-pattern>/jmxproxy/*</url-pattern>
  <url-pattern>/html/*</url-pattern>
  <url-pattern>/list</url-pattern>
  <url-pattern>/expire</url-pattern>
  <url-pattern>/sessions</url-pattern>
  <url-pattern>/start</url-pattern>
  <url-pattern>/stop</url-pattern>
  <url-pattern>/install</url-pattern>
  <url-pattern>/remove</url-pattern>
  <url-pattern>/deploy</url-pattern>
  <url-pattern>/undeploy</url-pattern>
  <url-pattern>/reload</url-pattern>
  <url-pattern>/save</url-pattern>
  <url-pattern>/serverinfo</url-pattern>
  <url-pattern>/status/*</url-pattern>
  <url-pattern>/roles</url-pattern>
  <url-pattern>/resources</url-pattern>
  </web-resource-collection>
- <#> <auth-constraint>
  <role-name>manager</role-name>
  </auth-constraint>
  </security-constraint>
- <!--

 Define the Login Configuration for this Application 

  -->
- <#> <login-config>
  <auth-method>DIGEST</auth-method>
  <realm-name>JDBCRealm</realm-name>
  </login-config>
- <!--

 Security roles referenced by this web application 

  -->
- <#> <security-role>
  <description>The role that is required to log in to the Manager 
Application</description>
  <role-name>manager</role-name>
  </security-role>

And I have the following in server.xml

<Realm className="*org.apache.catalina.realm.JDBCRealm*" debug="*99*" 
driverName="*com.mysql.jdbc.Driver*" 
connectionURL="*jdbc:mysql:///Tomcat_Realm*" connectionName="*xxxx*" 
connectionPassword="xxxxxxxx" userTable="*users*" 
userNameCol="*user_name*" userCredCol="*user_pass*" 
userRoleTable="*user_roles*" roleNameCol="*role_name*" digest="*MD5*" />

I give the same credentials when accessing my custom app and the manager 
app. In the former case, I am granted access; in the latter case, 
authentication fails (I am prompted to re-enter the credentials). I can 
access manager with no problem if I remove the <security-constraint> 
from web.xml or if I use the UserDatabaseRealm shipped with Tomcat, 
after putting the proper entry into tomcat-users.xml. But after adding 
my JDCRealm descriptor entry, I can no longer authenticate successfully 
using UserDatabaseRealm.

Should manager be able to work with JDBCRealm? If not, how can I make it 
work with userDatabaseRealm while other apps are using JDBCRealm?

-Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Manager app authentication not working with JDBCRealm

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Leone [mailto:midnightjava@verizon.net] 
> Subject: Re: Manager app authentication not working with JDBCRealm
> 
> But why does my custom app display "JDBCRealm" in the credentials 
> prompt?

Because the 401.jsp file in the manager webapp overrides the default
dialog box; since your custom webapp has no such error page, the
<realm-name> is used.  Note that <realm-name> is purely cosmetic; you
can put anything you want there.

> Either this is not the right way to make an app work with JDBCRealm 
> (though it works with my custom app), or there's something wrong in
> this version of Tomcat.

I don't think there's anything wrong with Tomcat 6.0 in this regard,
since it's working fine for us with a <Realm> other than
UserDatabaseRealm.

1) Do you perhaps have a conf/Catalina/[host]/manager.xml file with its
own <Realm>?

2) Have you checked the traffic between Tomcat and the DB server when
you attempt to log in to the manager webapp?

3) Have you emptied your browser's cache, including saved credentials?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Manager app authentication not working with JDBCRealm

Posted by Mark Leone <mi...@verizon.net>.
>> I noticed that the prompt for my credentials says 
>> "Enter username and password for 'Tomcat Manager 
>> Application'".
>>     
>
> That prompt comes from the 401.jsp file in the manager webapp, not the
> <realm-name> in the web.xml file; I don't think the <realm-name> is
> actually used anywhere.
>
>   
But why does my custom app display "JDBCRealm" in the credentials 
prompt? Something is making these two apps behave differently wrt 
authentication, and it seems that the fact that they display different 
authentication prompts could be a clue. Problem is, even with this clue, 
I don't have a clue. :)
> ??? There's no such <ResourceLink> in
> webapps/manager/META-INF/context.xml, nor in conf/context.xml, so where
> did that come from?  Sounds like you don't actually have a clean Tomcat
> 6 installation.
>   
Correct. I copied it over from my Tomcat 5 installation during the many 
gyrations I've been going through trying to find something that will 
make this work. I guess I lost track of what I changed at this point, 
but I'm certain it was failing with a fresh install.  But just to be 
sure, I started from scratch one more time with a clean deployment, and 
I still have the same problem. In fact, I did the same thing on my other 
system (after de-installing Tomcat 5.5), and I get the same behavior 
there-- admin authentication works out of the box, but then stops 
working after I change the realm to a JDBCRealm.

I only make two changes to the original distribution. In 
${catalina.home}\conf\server.xml, I comment out the UserDatabaseRealm 
and add a JDBCRealm;  and in 
${catalina.home}\webapps\manager\WEB-INF\web.xml, I change the 
login-config to

<login-config>
    <auth-method>DIGEST</auth-method>
    <realm-name>JDBCRealm</realm-name>
  </login-config>

Either this is not the right way to make an app work with JDBCRealm 
(though it works with my custom app), or there's something wrong in this 
version of Tomcat.

I appreciate all you've done, and I don't want to take up anymore of 
your time on this. Unless you have any final ideas, I'm ready to give up 
on making it work. Thanks again.

-Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Manager app authentication not working with JDBCRealm

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Leone [mailto:midnightjava@verizon.net] 
> Subject: Re: Manager app authentication not working with JDBCRealm
> 
> Implementing a JAASRealm sounds easy enough

I wasn't suggesting that you convert to a JAASRealm, but just providing
evidence that the manager webapp is not tied to the UserDatabaseRealm.

> I noticed that the prompt for my credentials says 
> "Enter username and password for 'Tomcat Manager 
> Application'".

That prompt comes from the 401.jsp file in the manager webapp, not the
<realm-name> in the web.xml file; I don't think the <realm-name> is
actually used anywhere.

> I've commented out the <resource-env-ref> element 
> in web.xml that was referencing the variable "users"
> mapped via the <ResouorceLink> in the context.xml file

??? There's no such <ResourceLink> in
webapps/manager/META-INF/context.xml, nor in conf/context.xml, so where
did that come from?  Sounds like you don't actually have a clean Tomcat
6 installation.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Manager app authentication not working with JDBCRealm

Posted by Mark Leone <mi...@verizon.net>.
Caldarale, Charles R wrote:
>> I wonder if the use of the UserDatabase resource is 
>> hard-wired into the manager app somehow.
>>     
>
> It's not; we use a JAASRealm for Tomcat 6.0.16 production, and the
> manager app quite happily authenticates with that.  All we changed in
> server.xml and the manager's web.xml were the following:
>
>   
I appreciate all the help you've given. Implementing a JAASRealm sounds 
easy enough, although it will be a few days at least before I'll have 
the time to write the LoginModule. Although it's good to know that 
JAASRealm is working for 6.0.16 in your production environment, I'm not 
100% sure it will work for me. AFAIK, JDBCRealm is working for 6.0.16 as 
well, and I seem to have a manager-specific problem that prevents it 
from working in my environment.

I just tried manager with Tomcat 5.5 (on a different system than my 6.0 
Tomcat), and authentication works there with JDBCRealm, with the same 
configuration I'm trying with 6.0. So either something needs to be 
configured differently in 6.0, something is broken in 6.0, or I have 
something wrong in my environment. Is anyone else using manager with 
JDBCRealm in 6.0?

I'm pretty sure now that manager is not even trying to use the JDBCRealm 
when I access it. I noticed that the prompt for my credentials says 
"Enter username and password for 'Tomcat Manager Application'". When I 
access my custom app, it says "Enter username and password for 
'JDBCRealm'". So for some reason the manage app is not trying to use the 
JDBCRealm. I've commented out the <resource-env-ref> element in web.xml 
that was referencing the variable "users" mapped via the <ResouorceLink> 
in the context.xml file, and I tried getting rid of the context.xml file 
as well. I don't know what else I can do to make manager use JDBCRealm 
just as my other apps do. They're configured exactly the same in 
web.xml, there are no context.xml or manager.xml files in play, and 
there is nothing in server.xml that is applied specifically to any of my 
apps.

-Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Manager app authentication not working with JDBCRealm

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Leone [mailto:midnightjava@verizon.net] 
> Subject: Re: Manager app authentication not working with JDBCRealm
> 
> I wonder if the use of the UserDatabase resource is 
> hard-wired into the manager app somehow.

It's not; we use a JAASRealm for Tomcat 6.0.16 production, and the
manager app quite happily authenticates with that.  All we changed in
server.xml and the manager's web.xml were the following:

conf/server.xml:

1) commented out the UserDatabase <Resource>

2) commented out the UserDatabaseRealm <Realm>

3) added the <Realm> for JAASRealm

(There is no <Resource> for a JAASRealm, of course.)

webapps/manager/WEB-INF/web.xml:

1) changed the <role-name> inside the <auth-constrain> to what we needed

2) changed the <role-name> inside <security-role> to the same as in #1

3) added a <transport-guarantee> of CONFIDENTIAL (irrelevant to your
situation)

Note that we left the <resource-env-ref> for
org.apache.catalina.UserDatabase alone.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Manager app authentication not working with JDBCRealm

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Caldarale, Charles R 
> Subject: RE: Manager app authentication not working with JDBCRealm
> 
> Note that we left the <resource-env-ref> for 
> org.apache.catalina.UserDatabase alone.

Also, we did not change the <realm-name> under <login-config> in the
manager web.xml file, although I don't think that will make a
difference.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Manager app authentication not working with JDBCRealm

Posted by Mark Leone <mi...@verizon.net>.
> O.k., I think that will break the world.  As far as I know, you may have
> only one <Realm> inside a given container (<Engine>, <Host>, <Context>);
> a <Realm> at a lower level overrides any at a higher one.  If you want
> all apps to use your JDBCRealm, you have to remove (or comment out) the
> default one for the <Engine>.
>
>
>   
I commented out the UserDatabaseRealm declaration, and I still cannot 
authenticate with manager, but I can with my custom app. This is hard to 
figure, as I've made very few changes to the configuration in the 
distribution, and there are very few entries in the server.xml and 
web.xml files. I've attached both of those files.

I wonder if the use of the UserDatabase resource is hard-wired into the 
manager app somehow. Looking at the web.xml for manager in the Tomcat 
distribution, I don't see how the deployment descriptor is specifying to 
use that resource for authentication. An environment variable "users" is 
mapped from the global context, but it's nowhere else referenced in 
web.xml. The eralm name in login-config is given as the description 
title for the manager app.

And I also don't understand why this stops working when I define a 
JDBCRealm in server.xml. On closer examination, I see that manager is 
not using UserDatabaseRealm, but using the UserDatabase resource directly.

-Mark

RE: Manager app authentication not working with JDBCRealm

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Leone [mailto:midnightjava@verizon.net] 
> Subject: Re: Manager app authentication not working with JDBCRealm
> 
> 2. I added to server.xml the JDBCRealm descriptor that I 
> showed earlier in the thread. I made no other changes.

O.k., I think that will break the world.  As far as I know, you may have
only one <Realm> inside a given container (<Engine>, <Host>, <Context>);
a <Realm> at a lower level overrides any at a higher one.  If you want
all apps to use your JDBCRealm, you have to remove (or comment out) the
default one for the <Engine>.

> Mar 19, 2008 11:58:00 PM 
> org.apache.tomcat.util.digester.SetPropertiesRule begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Realm} Setting 
> property 'debug' to '99' did not find a matching property.

Interesting, since it's shown in the docs.  Will have to dig into that
one.

> I have manager app directly under ${catalina.home}\webapps. 
> Is that correct?

Yes.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Manager app authentication not working with JDBCRealm

Posted by Mark Thomas <ma...@apache.org>.
Mark Leone wrote:
> Tomcat 6 still has the html page for the admin app that 
> says it can be downloaded if desired, so I assumed it was still 
> supported for 6.0.

This should be fixed (ie removed) by the next release.

Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Manager app authentication not working with JDBCRealm

Posted by Mark Leone <mi...@verizon.net>.
> There is no admin webapp for Tomcat 6; is that your own, or did you copy
> over stuff from a previous level of Tomcat?  If you did, that's likely
> the cause of your problem, since the configs and built-in webapps are
> not compatible across levels.
>   
I copied the admin app from Tomcat 5 after seeing that the manager app 
wasn't working right, just to see if I could get a clue from how it was 
configured. (Tomcat 6 still has the html page for the admin app that 
says it can be downloaded if desired, so I assumed it was still 
supported for 6.0.) I got rid of it, now, however. See below.
> All of those warnings need to be fixed; it's more evidence of copying
> config files from a previous level, which is a definite no-no.  You
> should start over with a clean installation of Tomcat 6, and then port
> (not copy) whatever you need from the older level.
>
>   
To enable a systematic approach, I started from scratch. I de-installed 
Tomcat and deleted all its files. Here's how it went.

1. I re-installed 6.0.16, specifying a user name with manager role for 
tomcat-users.xml. I was able to access manager using these credentials.

2. I added to server.xml the JDBCRealm descriptor that I showed earlier 
in the thread. I made no other changes. At this point, I could no longer 
authenticate to manager using the credentials in Tomcat-users.xml. 
(Perhaps when there was only one realm, UserDatabaseRealm was used as 
the default. Now that there are two, I have to point manager to the one 
to use? I tried earlier to do this using a <ResourceLink> element as 
described in Tomcat docs and the comments to manager's web.xml, but I 
must not have done it right, as I couldn't get it to work. I'd prefer 
anyway to get it working with JDBCRealm.).

3. I put the JDBC connector jar into ${catalina.home}\lib and copied 
into webapps my custom app that uses JDBCRealm for authentication, and 
tested it. It works fine, using the JDBC connection to authenticate a 
user with role manager.

4. I modified manager's web.xml login-config to be

<login-config>
    <auth-method>DIGEST</auth-method>
    <realm-name>JDBCRealm</realm-name>
  </login-config>

which is the same as my custom app. I cannot authenticate to manager 
using the JDBC credentials.

I now have no error messages (I believe) in my log file except the one 
about no matching property for debug. I don't know what's causing that, 
but perhaps it's the relevant clue. Here's my catalina.<date-time>.log 
file, showing restart and attempt to access manager app.

Mar 19, 2008 11:57:57 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Mar 19, 2008 11:57:57 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
Mar 19, 2008 11:58:00 PM 
org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Realm} Setting 
property 'debug' to '99' did not find a matching property.
Mar 19, 2008 11:58:00 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal 
performance in production environments was not found on the 
java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 
6.0\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program 
Files\ActivIdentity\ActivClient Mini\;C:\Program 
Files\QuickTime\QTSystem\;C:\Program Files\MySQL\MySQL Server 5.0\bin
Mar 19, 2008 11:58:00 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 19, 2008 11:58:00 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 491 ms
Mar 19, 2008 11:58:00 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 19, 2008 11:58:00 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
Mar 19, 2008 11:58:01 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 19, 2008 11:58:01 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 19, 2008 11:58:01 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16  config=null
Mar 19, 2008 11:58:01 PM org.apache.catalina.startup.Catalina start

I have manager app directly under ${catalina.home}\webapps. Is that correct?

-Mark



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Manager app authentication not working with JDBCRealm

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Leone [mailto:midnightjava@verizon.net] 
> Subject: Re: Manager app authentication not working with JDBCRealm
> 
> Mar 19, 2008 10:21:23 PM org.apache.catalina.startup.HostConfig 
> checkResources
> INFO: Undeploying context [/admin]

There is no admin webapp for Tomcat 6; is that your own, or did you copy
over stuff from a previous level of Tomcat?  If you did, that's likely
the cause of your problem, since the configs and built-in webapps are
not compatible across levels.

> Mar 19, 2008 10:21:34 PM org.apache.catalina.startup.HostConfig 
> deployDescriptor
> WARNING: A docBase C:\Program Files\Apache Software Foundation\Tomcat 
> 6.0\webapps\gators inside the host appBase has been 
> specified, and will be ignored

All of those warnings need to be fixed; it's more evidence of copying
config files from a previous level, which is a definite no-no.  You
should start over with a clean installation of Tomcat 6, and then port
(not copy) whatever you need from the older level.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Manager app authentication not working with JDBCRealm

Posted by Mark Leone <mi...@verizon.net>.
> Why do your posted XML fragments have asterisks and odd annotations like
> <#>?  Since what you posted doesn't appear to be just a copy & paste, it
> would be good to see the actual elements, attributes, and values.
>   
My mistake. I copied from the rendered XML doc instead of from the 
source. Here's the correct posting of the web.xml excerpt:

<security-constraint>
    <web-resource-collection>
      <web-resource-name>HTMLManger and Manager command</web-resource-name>
      <url-pattern>/jmxproxy/*</url-pattern>
      <url-pattern>/html/*</url-pattern>
      <url-pattern>/list</url-pattern>
      <url-pattern>/expire</url-pattern>
      <url-pattern>/sessions</url-pattern>
      <url-pattern>/start</url-pattern>
      <url-pattern>/stop</url-pattern>
      <url-pattern>/install</url-pattern>
      <url-pattern>/remove</url-pattern>
      <url-pattern>/deploy</url-pattern>
      <url-pattern>/undeploy</url-pattern>
      <url-pattern>/reload</url-pattern>
      <url-pattern>/save</url-pattern>
      <url-pattern>/serverinfo</url-pattern>
      <url-pattern>/status/*</url-pattern>
      <url-pattern>/roles</url-pattern>
      <url-pattern>/resources</url-pattern>
    </web-resource-collection>
   <auth-constraint>
    <role-name>manager</role-name>
    </auth-constraint>
  </security-constraint>

  <!-- Define the Login Configuration for this Application -->

  <login-config>
    <auth-method>DIGEST</auth-method>
    <realm-name>JDBCRealm</realm-name>
  </login-config>

  <!-- Security roles referenced by this web application -->

  <security-role>
    <description>
      The role that is required to log in to the Manager Application
    </description>
    <role-name>manager</role-name>
  </security-role>

And here's the server.xml excerpt (which I should have pointed out is 
inside the server/service/engine container):

<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" 
driverName="com.mysql.jdbc.Driver"
    connectionURL="jdbc:mysql:///Tomcat_Realm" connectionName="xxxx" 
connectionPassword="xxxx"
    userTable="users" userNameCol="user_name" userCredCol="user_pass" 
userRoleTable="user_roles"
    roleNameCol="role_name" digest="MD5" />
> 1) Make sure the debug level for the <Realm> is something large (e.g.,
> "99", not "*99*").
>   
Debug was set correctly, as shown above.
> 2) Check the logs after you make a request to the manager.
>   
Here's the contents of catalina.<date-time>.log. The only thing I see 
that seems perhaps relevant is the warning about no matching property 
for debug. Does it mean I have the realm descriptor in the wrong 
location (server/service/engine/realm)? I placed it right after the 
userDatabaseRealm that comes with the Tomcat distribution. There are 
warnings about docBases inside the host appbase that are being ignored. 
I don't understand these, but they don't seem related to my problem. 
These warnings pertain to <appname>.xml files inside 
${catalina.home}\conf\catalina\localhost\, with <context> elements 
defined with IP address and access log valves.

Mar 19, 2008 10:21:23 PM org.apache.catalina.startup.HostConfig 
checkResources
INFO: Undeploying context [/admin]
Mar 19, 2008 10:21:28 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Mar 19, 2008 10:21:29 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Mar 19, 2008 10:21:30 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
Mar 19, 2008 10:21:33 PM 
org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Realm} Setting 
property 'debug' to '99' did not find a matching property.
Mar 19, 2008 10:21:33 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal 
performance in production environments was not found on the 
java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 
6.0\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program 
Files\ActivIdentity\ActivClient Mini\;C:\Program 
Files\QuickTime\QTSystem\;C:\Program Files\MySQL\MySQL Server 5.0\bin
Mar 19, 2008 10:21:33 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 19, 2008 10:21:33 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 509 ms
Mar 19, 2008 10:21:33 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 19, 2008 10:21:33 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
Mar 19, 2008 10:21:34 PM org.apache.catalina.startup.HostConfig 
deployDescriptor
WARNING: A docBase C:\Program Files\Apache Software Foundation\Tomcat 
6.0\webapps\gators inside the host appBase has been specified, and will 
be ignored
Mar 19, 2008 10:21:34 PM org.apache.catalina.startup.HostConfig 
deployDescriptor
WARNING: A docBase C:\Program Files\Apache Software Foundation\Tomcat 
6.0\webapps\manager inside the host appBase has been specified, and will 
be ignored
Mar 19, 2008 10:21:34 PM org.apache.catalina.startup.HostConfig 
deployDescriptor
WARNING: A docBase C:\Program Files\Apache Software Foundation\Tomcat 
6.0\webapps\Pics inside the host appBase has been specified, and will be 
ignored
Mar 19, 2008 10:21:34 PM org.apache.catalina.startup.HostConfig 
deployDescriptor
WARNING: A docBase C:\Program Files\Apache Software Foundation\Tomcat 
6.0\webapps\ROOT inside the host appBase has been specified, and will be 
ignored
Mar 19, 2008 10:21:34 PM org.apache.catalina.startup.HostConfig 
deployDescriptor
WARNING: A docBase C:\Program Files\Apache Software Foundation\Tomcat 
6.0\webapps\webdav inside the host appBase has been specified, and will 
be ignored
Mar 19, 2008 10:21:35 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 19, 2008 10:21:35 PM org.apache.jk.common.ChannelSocket init
> 3) Use database tracing, Wireshark, or equivalent to see if the Realm is
> actually trying to reach the database when you attempt to use the
> manager.
>
>   
Not sure how to do this, but I'll look into it. Thanks for your suggestions.

-Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Manager app authentication not working with JDBCRealm

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Leone [mailto:midnightjava@verizon.net] 
> Subject: Re: Manager app authentication not working with JDBCRealm
> 
> I'm using Tomcat 6.0.16. I have my JDBC Connector jar 
> file in %catalina_home%\lib

O.k., that looks good.

Why do your posted XML fragments have asterisks and odd annotations like
<#>?  Since what you posted doesn't appear to be just a copy & paste, it
would be good to see the actual elements, attributes, and values.

Things to try:

1) Make sure the debug level for the <Realm> is something large (e.g.,
"99", not "*99*").

2) Check the logs after you make a request to the manager.

3) Use database tracing, Wireshark, or equivalent to see if the Realm is
actually trying to reach the database when you attempt to use the
manager.

This is probably something obvious, but I'm not seeing it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Manager app authentication not working with JDBCRealm

Posted by Mark Leone <mi...@verizon.net>.
I wonder how many times we have to remind people to provide the Tomcat
> level they're using.
>
> Besides that rather critical piece of information, also tell us where
> you put your driver classes or jar for accessing the authentication
> database.
>
>  - Chuck
>   
Sorry about that. I'm using Tomcat 6.0.16. I have my JDBC Connector jar 
file in %catalina_home%\lib

-Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Manager app authentication not working with JDBCRealm

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Leone [mailto:midnightjava@verizon.net] 
> Subject: Manager app authentication not working with JDBCRealm
> 
> I can't get the manager app working with authentication using 
> JDBCRealm, even though I've configured it identically to an app
> I developed that uses the same JDBCRealm instance successfully.

I wonder how many times we have to remind people to provide the Tomcat
level they're using.

Besides that rather critical piece of information, also tell us where
you put your driver classes or jar for accessing the authentication
database.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org