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

winmail.dat

Reply via email to