At firsty glance the rolename and 0 in front of the column names might
not want to be there. Everything else looks like what I'm using for
Database Login right now, and it works. You may be confusing Jboss by
labeling the columns like that.
--- Pelle Poluha <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I'm trying to use the DatabaseServerLoginModule for authentication
> and role
> mapping. Earlier, I used the UsersRolesLoginModule successfully.
>
> As can be seen below (PreparedStatements printed to screen by JBoss),
> the
> authentication goes well but it seems the role mapping fails.
>
> [UserManager] select password from user where username=?
> [UserManager] select password from user where username=?
> [UserManager] 'pelle'
> User 'pelle' authenticated.
> [UserManager] select rolename Role, 0 RoleGroup from rolemapper where
> username=?
>
> [UserManager] select rolename Role, 0 RoleGroup from rolemapper where
> username=?
>
> [UserManager] 'pelle'
> [UserManager] Insufficient method permissions, principal=pelle,
> method=create, r
> equiredRoles=[user]
>
> When I query the database manually, I get the following results:
>
> mysql> select rolename Role, 0 RoleGroup from rolemapper where
> username='pelle';
>
> +------+-----------+
> | Role | RoleGroup |
> +------+-----------+
> | boss | 0 |
> | user | 0 |
> +------+-----------+
>
> The auth.conf looks like this:
> other {
> org.jboss.security.auth.spi.DatabaseServerLoginModule required
> dsJndiName="java:/mySQL"
> principalsQuery="select password from user where username=?"
> rolesQuery="select rolename Role, 0 RoleGroup from rolemapper
> where
> username=?"
> ;
> };
>
> In standardjboss.xml, I have added the following line:
> <jboss>
> <security-domain>java:/jaas/other</security-domain>
> <secure>false</secure>
> ...
>
> Any help appreciated.
>
> Regards,
> Pelle Poluha
>
> ATTACHMENT part 2 application/ms-tnef name=winmail.dat
=====
Grim Shieldsson (James A Barrows)
Acting Chieftain of Clan StormWolf
Barbarian Freehold Alliance
Oppurtunity doesn't knock. It only presents itself after you kick down the door.
--Kyle Chandler
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user