The roles query should be something like:
select Role,RoleGroup from Roles where username=?
You have:
select rolename Role, 0 RoleGroup from rolemapper where username=?"
The rolename Role and 0 RoleGroup are prolly causing the problem. I'm
not sure why this would cause a database structure change.
--- Pelle Poluha <[EMAIL PROTECTED]> wrote:
> Thanks but the error I get says the role 'user' is required to invoke
> create. And the user 'pelle' has the role 'user' as the MySql table
> shows.
> And everything works just fine as soon as I change to the
> UsersRolesLoginModule.
>
> Perhaps there is something wrong with the roles query as Grim
> Shieldsson
> suggested (but then I would have to change the structure of the table
> which
> I'd prefer not to).
>
> Regards,
> Pelle Poluha
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Andre
> > Vermeulen@i-Commerce
> > Sent: den 11 juni 2001 10:36
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: [JBoss-user] Problems using DatabaseServerLoginModule
> >
> >
> > Just a few ideas.
> >
> > Seems like don't have any permissoins set on your create
> > method (Not telling
> > which role can execute the create method), or change the
> > permissions on the
> > bean level that all methods use the same role.
> >
> > helpfull ?
> >
> > -----Original Message-----
> > From: Pelle Poluha [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, June 11, 2001 10:10 AM
> > To: [EMAIL PROTECTED]
> > Subject: [JBoss-user] Problems using DatabaseServerLoginModule
> >
> >
> > 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
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-user
> >
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
=====
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