[JBoss-user] [Security JAAS/JBoss] - Re: Retrieving user name
No, I'm able to fetch the user name from request, if I am in a JSP or whetever I can have access to the http request. I need to fetch user name if I don't have access to the request, i.e., from an helper class. Is it possible doing it calling methods on mbean server service or security manager? I wasn't able to figure it out thanks View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3890137#3890137 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3890137 --- SF.Net email is Sponsored by the Better Software Conference EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile Plan-Driven Development * Managing Projects Teams * Testing QA Security * Process Improvement Measurement * http://www.sqe.com/bsce5sf ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Security JAAS/JBoss] - Re: Retrieving user name
May be this works for you! SecurityAssociation.getPrincipal().getName() View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3890162#3890162 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3890162 --- SF.Net email is Sponsored by the Better Software Conference EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile Plan-Driven Development * Managing Projects Teams * Testing QA Security * Process Improvement Measurement * http://www.sqe.com/bsce5sf ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Security JAAS/JBoss] - Re: Retrieving user name
your method is simpler then what I figured out, certailnly: Context securityCtx = null; | AuthenticationManager securityMgr = null; | InitialContext iniCtx = new InitialContext(); | securityCtx = (Context) iniCtx.lookup(java:comp/env/security); | securityMgr = (AuthenticationManager) securityCtx.lookup(securityMgr); | Subject subject = securityMgr.getActiveSubject(); | return subject.getPrincipals(); I'll try it, thanks View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3890190#3890190 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3890190 --- SF.Net email is Sponsored by the Better Software Conference EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile Plan-Driven Development * Managing Projects Teams * Testing QA Security * Process Improvement Measurement * http://www.sqe.com/bsce5sf ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Security JAAS/JBoss] - Re: Retrieving user name
My guess is that in your JSP/servlet, the call to request.getUserPrincipal() is returning null. If you are using a custom login module then you need to define a group named CallerPrincipal to which you can add your Principal impl class. If you do this then the request.getUserPrincipal() returns your custom Principal impl (of course you will need to cast it to your impl class). HTH Ashwin Karkala View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3890113#3890113 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3890113 --- SF.Net email is Sponsored by the Better Software Conference EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile Plan-Driven Development * Managing Projects Teams * Testing QA Security * Process Improvement Measurement * http://www.sqe.com/bsce5sf ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user