[jboss-user] [Security & JAAS/JBoss] - Re: Accessing Roles from Custom LoginModule return NULL

ejb3workshop do-not-reply at jboss.com
Thu Oct 25 06:35:29 EDT 2007


I have managed to resolve this problem by correctly implementing the commit method as :


  |  public boolean commit() throws LoginException {
  |     logger.info("Granted Permissions");
  |     JAASUser user = new JAASUser(1,userid);
  |     JAASRole role = new JAASRole("friends");
  |     Group grp = new JAASGroup("Roles");
  |     grp.addMember(new JAASRole("friend"));
  |     grp.addMember(new JAASRole("friends"));
  | 
  |     subject.getPrincipals().add(user);
  |     subject.getPrincipals().add(role);    
  |     subject.getPrincipals().add(grp);    
  |     return true;
  |   }
  | 

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

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



More information about the jboss-user mailing list