geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: SQLLoginModule configuration (was re: retrieving the datasource)
Date Thu, 10 Nov 2005 17:29:22 GMT
Something similar to this should work:

     public final static String USER_SELECT = "userSelect";
     public final static String GROUP_SELECT = "groupSelect";
     public final static String CONNECTION_URL = "jdbcURL";
     public final static String USER = "jdbcUser";
     public final static String PASSWORD = "jdbcPassword";
     public final static String DRIVER = "jdbcDriver";

     <gbean name="roller-realm"
         <attribute name="realmName">roller-realm</attribute>
         <xml-reference name="LoginModuleConfiguration">
                 <lc:login-module control-flag="REQUIRED"  
                     <lc:option name="jdbcUser">roller</lc:option>
                     <lc:option name="jdbcPassword">roller</lc:option>
                     <lc:option name="userSelect">SELECT username,  
passphrase FROM rolleruser where username = ?</lc:option>
                     <lc:option name="groupSelect">SELECT rolename,  
username FROM userrole where username = ?</lc:option>
         <reference name="ServerInfo">
         <reference name="LoginService">

You should definitely check the sql I invented for you.

You will still need to map the group principals to the roles your app  
uses.  My guess from the name of the table is that the group and role  
name will be identical.

Your mapping might look something like this

    <sec:security default-role="UNASSIGNED" doas-current-caller="true">
l" name="guest"/>

             <sec:role role-name="UNASSIGNED">
l" name="guest" designated-run-as="true"/>

             <sec:role role-name="USER">
al" name="USER"/>

             <sec:role role-name="ADMIN">
al" name="ADMIN" designated-run-as="true"/>

Hope this helps
david jencks

On Nov 10, 2005, at 6:17 AM, Miguel A Paraz wrote:

> On 10/20/05, <> wrote:
>> OK, I can verify users against the database using the
>> SQLLoginModule. I've created a servlet (my first one
>> ever!) that takes in the user information and stores
>> it into the same table of the database, and adds an
>> entry to the groups table, too. They can then go to
>> the login page, login and they even verify!
> Hi,
> Sorry but I couldn't figure out how to write a SQLLoginModule
> configuration. I'm trying to deploy Roller on Geronimo. The Tomcat
> realm configuration, under the specific context, is as follows. What's
> the equivalent Geronimo configuration?
> <Realm className="org.apache.catalina.realm.JDBCRealm"
>     driverName="com.mysql.jdbc.Driver"
> connectionURL="jdbc:mysql://localhost:3306/roller? 
> autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf 
> -8&amp;mysqlEncoding=utf8"
>     connectionName="roller"
>     connectionPassword="roller"
>     userTable="rolleruser"
>     userNameCol="username"
>     userCredCol="passphrase"
>     userRoleTable="userrole"
>     roleNameCol="rolename" debug="0" />

View raw message