Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getUserPrincipal don't return user principal :(

 
alexandre russel
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I created a login module with JBoss. It create the callerPrincipal:
SimpleGroup roles = new SimpleGroup("Roles");
SimpleGroup callerPrincipal = new SimpleGroup("CallerPrincipal");
SimpleGroup cpLogin = new SimpleGroup("login");
cpLogin.addMember(new SimplePrincipal("my login name"));
SimpleGroup cpId = new SimpleGroup("id");
cpId.addMember(new SimplePrincipal("my id"));
callerPrincipal.addMember(cpLogin);
callerPrincipal.addMember(cpId);
roles.addMember(new SimplePrincipal("manager"));
log.debug(callerPrincipal.toString());
Group[] roleSets = {roles, callerPrincipal};

the log file gives me: CallerPrincipal(members:login(members:my login name),id(members:my id))

Everything is fine but when I call userPrincipal from a JSP:
java.security.acl.Group group = (java.security.acl.Group) request.getUserPrincipal();
<%= group.toString() %><br/>

then only the first member of the callerPrincipal group is there .
login(members:my login)

How can I access the rest of my group?
thanks for your help.
alex
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic