Hi there.
I'm afraid I don't have terribly useful information, but I did want to let you know
that in some instances, Principal.getName() does indeed return the username. I'm
using a custom written database login module, and after returning from authentication,
I can perform the following to locate the username (jsm is the variable name for a
JaasSecurityManager looked up via JNDI using the JNDI name of the security realm my
web app is using):
|
| Subject s = jsm.getActiveSubject();
| Set pr = s.getPrincipals();
| Iterator i = pr.iterator();
| while (i.hasNext())
| {
| Principal p = (Principal)i.next();
| out.println("<h3>Principal: " + p.getName() + "</h3>");
| }
|
|
This block iterates through all principals in the current user, and displays their
name. The first principal entry comes back as the username used to log in, while the
second entry comes back as "Roles". I'm not sure where that second one comes from,
but I'm still rather new to JAAS, so it doesn't surprise me when weird things happen.
;)
Hope that helps a little. Maybe it will at least point you in a new direction to look.
-- Alec
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3842289#3842289
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3842289
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user