[jboss-user] [Security & JAAS/JBoss] - DatabaseLoginServerModule - query with id possible?

NSchweig do-not-reply at jboss.com
Sun May 10 14:17:45 EDT 2009


Hi,

I have got an application with databaseserverloginmodule.
The rolesQuery I tested with a simple example had the following queries:

<module-option name="principalsQuery">
  |                     select password from cmtuser where username=?</module-option>
  |                 <module-option name="rolesQuery">
  |                     select userroles, 'Roles' from userroles where username=?</module-option>
  | 

I created the database in a way that the queries could work.
(table roles : int id, rolename varchar)
(table users: int id, username varchar, passwd varchar)
(table userroles: int id, userroles varchar, username varchar)

Now I have got another application where the jointable user/roles (cmtuser_role) contains the ids from the user and the roles and not the names.
table cmtuser_role (int id, cmtuser_id int, roles_id int)

and I have got the problem that the queries I used in the other application are not working.

The rolesQuery now should be sth. like
          
  | select userroles, 'Roles' from userroles where userid=?

but I think "where user_id=" can not work. Is there a possibility to write a subquery in the roles query string to get the id or sth.?

Or do I have to write a custom login module?

Thanks for your hints.
NSchweig


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229900#4229900

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229900



More information about the jboss-user mailing list