Hi,
I have to repost this issue again.
I am using JRun JDBC login module in JRun4.0 to integrate authentication with DB2 
tables. I used JMC and setup user module as jrun.security.JDBCLoginModule against the 
table 'users'. I also setup role module as jrun.security.JDBCLoginModule against the 
table 'roles'.
I have a user called "admin" already created in these tables and have a role called 
"adminrole". However, when I login as "admin", Jrun will throw me to 403 error page, 
where I have the following code:
 
java.security.Principal principal = request.getUserPrincipal();
out.println(principal.toString());  //This will print out "AuthenticatedPrincipal 
name=admin".
 
boolean inRole = request.isUserInRole("adminrole");   //This will return false.
 
So, it seemed that Jrun can authenticate the user properly but not getting the correct 
role.
 
Following is my config file and schema. Is there anything wrong with what I am doing?
 
- auth.config:
defaultUser
{
jrun.security.JDBCLoginModule requisite userNameColumn="login" 
dataSourceJNDIName="RXDS" tableName="users" mode="USER" passwordColumn="password";
};
defaultRole
{
jrun.security.JDBCLoginModule requisite roleColumn="rolename" userNameColumn="login" 
tableName="roles" dataSourceJNDIName="RXDS" mode="ROLE";
};
 
- uses.sql
CREATE TABLE users(
 -- login: Login id of the gui user
 login  char(8)   not null CONSTRAINT usersC_UCNT UNIQUE,
 -- name: Full name of the user
 name            char(128)               not null,
 -- password:
 password        char(8)                 not null,
) ;
 
-roles.sql
CREATE TABLE roles(
 -- login: Login id of the gui user
 login  char(8)                not null,
 -- rolename:
 rolename        char(12)               not null
) ;
 

Your help is greatly appreciated!
YZ

______________________________________________________________________
Get the JRun Web Application Construction Kit - the only book written specifically for 
JRun developers.
http://www.amazon.com/exec/obidos/ASIN/0789726009/houseoffusion
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to