[jboss-user] [JBoss Seam] - access to userPrincipal's role of the external context

adrien.loyat do-not-reply at jboss.com
Tue Aug 21 05:32:44 EDT 2007


Hello

I'm using jboss authentification in my seam application as described in Securing a Web Application in JBoss AS in the wiki.

In a back bean, i'm trying to pupulate identity classe. I am able to get the user name like this :

anonymous wrote : 
  | HttpServletRequest req = (HttpServletRequest) facesContext.getExternalContext().getRequest();
  | System.out.println(	"req login : " + req.getUserPrincipal().getName());
  | identity.setUsername(req.getUserPrincipal().getName());
  | identity.login();
  | 

I want to get the role too. When debbuging, i can see that req.getUserPrincipal() is a JBossGenericPrincipal. So i should be able to use 
req.getUserPrincipal().getRoles(). Nevertheless JBossGenericPrincipal is not visible for me. So I can't cast req.getUserPrincipal() into JBossGenericPrincipal .

Does anybody has I idea on how to access to the roles in the external contexts ?

Thanks for your help.
Adrien



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

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



More information about the jboss-user mailing list