Hi,
I don't have a problem with my SQL Server database and authentication.  One thing I 
noticed is that your user table has three columns all not null.  My two tables have 
two columns each according to the documentation: 

http://livedocs.macromedia.com/jrun4docs/JRun_Administrators_Guide/authentic4.jsp#1123090

In the JMC for your modules are you using "Use Details" or "Use Query?"  I'm using 
"Use Details."

I will try and reproduce this with DB2 tomorrow using your definitions.

Ted Zimmerman



-----Original Message-----
From: Zhang, Yuying [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 21, 2002 11:46 AM
To: JRun-Talk
Subject: JDBC login module in JRun4.0


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


______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to