the tomcat user/role gets configured in a flat file called tomcat-users.xml which lives in your tomcat directory. the tomcat user loads the file as a JNDI resource by having the following directive in the server context of server.xml:

<!-- Global JNDI resources -->
 <GlobalNamingResources>

   <!-- 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>


then your tomcat-users.xml file should look something like this (it probably already does):
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>


note that you can define your own roles and users and code your own user auth module to use this as well. additionally if you want to use the manager/admin webapps you will need to configure roles for manager and admin and add users that have those roles because those roles are how the manager and admin apps authenticate.

hope that solves your problem.

.sander



{ -------- Rick Roberts was saying -------- }:

Rick Roberts wrote:

Thanks for reply Mike.

After thinkin about this message some more;

I think that the reason I am getting this message is because I still have not successfully created a JDBC Realm.

I'm thinking that the Roles are defined in the database that I'm not corectly reading yet.


Otherwise; where would a <security-role> element belong? Should it be part of web.xml?

I am assuming (lots of stuff, because I have not done this before) that the ROLE field in the database is where the security-roles are defined.

Please tell me where my mistake is.

Thanks


--
------------------------------------------------------------------------
I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones.
- Einstein


sander-martijn <mailto:[EMAIL PROTECTED]>
interface developer | architect
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
www.sander-martijn.com <http://www.sander-martijn.com>

------------------------------------------------------------------------


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to