Jburugupalli wrote:

>But why dint u concentrate on the other inherited method 
>from UserNamePasswor.... 
>getIdentity() which returns a principal that is 
>nothing but your own Principal class with product info 
>or u can even use the static method 
>SecurityAssociation.getPrincipal(); which returns the current principal... 


I'm proceeding step by step.
For the moment I have forgotten the attribute product, 
I'm trying to send from Client to Server a XMalfSimplePrincipal that carries name and 
product attributes 
even if the XMalfDatabaseServerLoginModule uses ONLY name (product will be used later, 
I hope :-)).

In XMalfDatabaseServerLoginModule I copied getUsername()
method from UsernamePasswordLoginModule (if I'm able to change
it I'll be able to write getProduct() method later).

This is the code:

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

It obviously run.
When I change getUsername() in this way:

protected String getUsername() {
 String username = null;
      
  if( SecurityAssociation.getPrincipal() != null )
    username = SecurityAssociation.getPrincipal().getName();

  return username;
}

the method fails :-(

I tried to concentrate on getIdentity() method but 
- it returns identity
- identity is set inside login() method (identity = createIdentity(name))
- createIdentity() is used after having called CallbackHandler
- CallbackHandler returns password and name (it should return product too, but I don't 
understand which 
CallbackHandler is used by
UsernamePasswordLoginModule and why I had to use a CallbackHandler,
server side, if I already have received user, password and product
from the Client).

Sorry if I'm boring you :-(
Thanks
Moreno
 

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

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


-------------------------------------------------------
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