Hi, 

I am currently using a DatabaseServerLoginModule to authenticate into my web 
application. My login-config.xml has the following section:


  | 
  |     <application-policy name = "myRealm">
  |       <authentication>
  |         <login-module 
code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
  |           <module-option name = "dsJndiName">java:/MyDS</module-option>
  |           <module-option name = "principalsQuery">select distinct password 
from principal p where p.username = ?</module-option>
  |           <module-option name = "rolesQuery">select r.name, 'Roles' FROM 
role r, principal p, principal_role pr where p.principal_id = pr.principal_id 
AND r.role_id = pr.role_id AND p.username = ?</module-option>
  |           <module-option name = "hashAlgorithm">MD5</module-option>
  |         </login-module>
  |       </authentication>
  |     </application-policy>
  | 

This works just fine.

Now, in a struts action, I would like to get the information about the logged 
on user. Specifically, I would like to get the principal_id that stored in the 
principal table that corresponds with the logged on user. What's the easiest 
way to do that? 

Thanks,

Scott


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

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


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to