tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: Question configurung JBDCRealm (Tomcat 5.5.9)
Date Wed, 21 Dec 2005 13:31:29 GMT
Guten Tag  Peter
Since rolNameCol is defined as "The name of the column, in the user roles table, that contains
the name of a role assigned to this user.
so you will need 2 tables 'users' and 'user-roles'"

Then you will need to create 2 tables 'users' and 'user-roles' where user_name is a foreign
key to role assigned within the 'user_roles' table
create table users (
  user_name         varchar(15) not null primary key,
  user_pass         varchar(15) not null
);

create table user_roles (
  user_name         varchar(15) not null,
  role_name         varchar(15) not null,
  primary key (user_name, role_name)
);

begreife?
Martin -


     <Realm   className="org.apache.catalina.realm.JNDIRealm" debug="99"
     connectionURL="ldap://localhost:389"
       userPattern="uid={0},ou=people,dc=mycompany,dc=com"
          roleBase="ou=groups,dc=mycompany,dc=com"
          roleName="cn"
        roleSearch="(uniqueMember={0})"
/>
 

----- Original Message ----- 
From: <Peter.Zoche@materna.de>
To: <users@tomcat.apache.org>
Sent: Wednesday, December 21, 2005 6:03 AM
Subject: Question configurung JBDCRealm (Tomcat 5.5.9)


> Hi all!
> 
> I have got a question regarding setup of a JBDCRealm. I read the HOW-TO
> on Tomcat homepage, and I am wondering about the database structure.
> I have an existing application, and the database it uses has got a table
> 'users'
> with the follwing columns: login, password, roleid,... where the roleid is a
> foreign key to the table 'roles' which has columns 'id' and 'rolename'.
> It is sufficient for me because every user can only have one role. Is there
> a way to use this database structure with JDBCRealm? Or do I have to
> add more tables as described in the HOW-TO? My database structure
> already contains all information, so it would be overhead to produce an
> extra table, I think. I tried the following:
> 
> <Realm className="org.apache.catalina.realm.JDBCRealm"
> debug="99" driverName="org.postgresql.Driver"
> connectionURL="jdbc:postgresql://localhost:5432/
> testwebapp?user=login&amp;password=pwd"
> userTable="users" userNameCol="login"
> userCredCol="password" userRoleTable="users"
> roleNameCol="roleid" />
> 
> but I got problems on roleNameCol="roleid". How can I get the rolename
> from table roles?
> 
> Perhaps I missed something, and someone has an idea.
> 
> Thanks
> 
> Peter
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
>
Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message