0 Replies Latest reply on Oct 10, 2005 1:35 PM by Schacher

    list of roles of a principal

    Schacher Newbie

      i need a list of roles of a principal.

      i tried to invoke the method JaasSecurityManagerService.getUserRoles(String securityDomain, Principal principal)
      as mentioned here:

       InitialContext jndiContext = new InitialContext();
       MBeanServer server = MBeanServerLocator.locateJBoss();
       ObjectName jaasMgr = new ObjectName("jboss.security:service=JaasSecurityManager");
       Object[] params = {"securityDomain", sc.getCallerPrincipal()}; // sc = sessioncontext
       String[] signature = {"java.lang.String", "java.security.Principal"};
       Set set = (Set) server.invoke(jaasMgr, "getUserRoles", params, signature);

      java.lang.IllegalArgumentException: Unable to find operation getUserRoles(java.lang.String,java.security.Principal)

      according to the API JBoss 4.0.2, i also have to pass the credentials (API JBoss 4.0.3 is not available):
       getUserRoles(java.lang.String securityDomain, java.security.Principal principal, java.lang.Object credential)

      problem: i don't have the credentials at this time

      do i really need the credentials (is the wiki-page wrong?) and if yes, how can i get the credentials (i only have the informations of the sessioncontext)

      thank you for reply

      (i'm using jboss-4.0.3rc1)