Hi,
I'm trying to extend DatabaseServerLoginModule but I have problems
in getRoleSets() method.
>From Client I receive a modified SimplePrincipal that contains
name/password/product (I added product class member).

In MyDatabaseServerLoginModule I changed the rolesQuery:

"select Role, RoleGroup from Roles where PrincipalID=? 
and productID=?

In getRoleSets() method I have to prepare the SQL Statement:

String username = getUsername();
String product = getProduct();            /* METHOD I MUST WRITE !!!!! */

ps = conn.prepareStatement(rolesQuery);
try {
  ps.setString(1, username);
  ps.setString(2, product);
}

My class inherits getUsername() method from DatabaseServerLoginModule
(that inherits the method from UsernamePasswordLoginModule):
This method looks like:

protected String getUsername()
   {
      String username = null;
      if( getIdentity() != null )
         username = getIdentity().getName();
      return username;
   }

If I'm right this method uses an identity created in login() method.

My question is:
I need to write getProduct() method but in this case
I need to overwrite login() method in order to create an identity
with name and product inside of it ?
Login() method retrieves username and password, after 
Callbackhandler.handle() method, calling getUsernameAndPassword()
method: must I change getUsernameAndPassword() method too ? 

I'm very confused :-(

Thank you for any suggestion,
Moreno

 

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

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


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to